![](/user_photo/2706_HbeT2.jpg)
Android Lecture 3
.pdf![](/html/2706/1189/html_0tPUuZBCct.R1Xr/htmlconvd-oXUEJ921x1.jpg)
Intent.EXTRA_EMAIL: email recipients
Intent newInt = new Intent(Intent.ACTION_SEND); newInt.putExtra(android.content.Intent.EXTRA_EMAIL,
new String[]{"
“aporter@cs.umd.edu”, “ceo@microsoft.com”," “potus@whitehouse.gov”,“mozart@musician.org”
}
);
![](/html/2706/1189/html_0tPUuZBCct.R1Xr/htmlconvd-oXUEJ922x1.jpg)
Several forms depending on data types, e.g.,
putExtra(String name, String value); putExtra(String name, float[] value);
…
![](/html/2706/1189/html_0tPUuZBCct.R1Xr/htmlconvd-oXUEJ923x1.jpg)
Specify how Intent should be handled
![](/html/2706/1189/html_0tPUuZBCct.R1Xr/htmlconvd-oXUEJ924x1.jpg)
FLAG_ACTIVITY_NO_HISTORY
Don’t put this Activity in the History stack
FLAG_DEBUG_LOG_RESOLUTION
Print extra logging information when this Intent is processed
![](/html/2706/1189/html_0tPUuZBCct.R1Xr/htmlconvd-oXUEJ925x1.jpg)
Intent newInt = new Intent(Intent.ACTION_SEND); newInt.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
![](/html/2706/1189/html_0tPUuZBCct.R1Xr/htmlconvd-oXUEJ926x1.jpg)
startActivity(Intent intent,…) startActivityForResult(Intent intent, …)
![](/html/2706/1189/html_0tPUuZBCct.R1Xr/htmlconvd-oXUEJ927x1.jpg)
Can be named explicitly by setting the intent’s component
Can be determined implicitly
![](/html/2706/1189/html_0tPUuZBCct.R1Xr/htmlconvd-oXUEJ928x1.jpg)
HelloWorldWithLogin two Activities
LoginActivity checks username & password and then starts HelloAndroidActivity
HelloAndroidActivity shows “hello Android” message
![](/html/2706/1189/html_0tPUuZBCct.R1Xr/htmlconvd-oXUEJ929x1.jpg)
When the Activity to be activated is not explicitly named, Android tries to find Activities that match the Intent
This process is called intent resolution
![](/html/2706/1189/html_0tPUuZBCct.R1Xr/htmlconvd-oXUEJ930x1.jpg)
An Intent describing a desired operation
IntentFilters which describe which operations an Activity can handle
Specified either in AndroidManifest.xml or programmatically