1.Implicit Intents:
- This is the main power of android design, we just declare and intent and leave it to the platform to find the activity that can respond to the intent. Here we do not declare the target component and hence is typically used for activating components of other applications seamlessly.
- Implicit Intents have not specified a component; Instead, they must include enough information for the system to determine which of the available components is best to run for that intent.
Ex: Intent webIntent=new Intent(Intent.ACTION_VIEW,Uri.pars("http://www.google.com"));
startActivity(webIntent);
Ex: Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Constants.mImageCaptureUri);
startActivity(intent );
2.Explicit Intents:
In an Explicit Intents, we actually specify the activity that is required to respond to the intent.In othere words we explicitly designate the target component.This is typically used for application internal messages
Ex: Intent launchExplicitIntent=new Intent(this,Game.class);
startActivity(launchExplicitIntent);
No comments:
Post a Comment