Intent
Android Intent is the message that is passed between components such as activities, content providers, broadcast receivers, services etc.It is generally used with startActivity() method to invoke activity, broadcast receiver that's it.
Types of Android Intents
there are two type of the intent
1.Implicit Intent
2.Explicit Intent
Implicit Intent- Implicit Intent doesn't specifiy the component. In such case,
intent provides information of available components provided by the
system that is to be invoked.
- Intent intent=new Intent(Intent.ACTION_VIEW);
- intent.setData(Uri.parse("http://www.facebook.com"));
- startActivity(intent);
Explicit Intent
Explicit Intent specifies the component. In such case, intent provides the external class to be invoked.
- Intent i = new Intent(getApplicationContext(), ActivityOne.class);
- startActivity(i);
No comments:
Post a Comment