Saturday, 5 March 2016

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.

  1. Intent intent=new Intent(Intent.ACTION_VIEW);  
  2. intent.setData(Uri.parse("http://www.facebook.com"));  
  3. startActivity(intent);
Explicit Intent
 Explicit Intent specifies the component. In such case, intent provides the external class to be invoked.

  1.    Intent i = new Intent(getApplicationContext(), ActivityOne.class);  
  2.    startActivity(i);

 Thanks

Vinod sonava


 

 

 

No comments:

Post a Comment