Explain the use of Intent in an Android Application code example
Example 1: intent android
Intent intent = new Intent(MainActivity.this,Activity.class);
Example 2: intent android
Intent intent = new Intent(MainActivity.this,MainActivity2.class);
intent.putExtra("key",value);
startActivity(intent);
////////////////////
String string =getIntent().getStringExtra("key");