SetType()- This method specifies a MIME type. setData() - This method is only to specifies a URI. so it going to show something which we have given in setData method. In the above example we are giving action as view. In implicit intent we have to pass an action using setAction() as shown below example. Implicit Intents − It going to connect with out side application such as call, mail, phone,see any website. To start new activity we have to create Intent object and pass source activity and destination activity as shown below − Intent send = new Intent(MainActivity.this, SecondActivity.class) Īnd we should declare about second activity in Manifest.xml file or else it going to show run time exception. There are two intents available in android as Implicit Intents and Explicit Intents.Įxplicit Intent − It going to connect the internal world of an application such as start activity or send data between two activities. It is mostly used to start activity, send broadcast receiver, start services and send message between two activities. Before getting into types of intent, we should know what is an intent?.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |