Let's say that we have a button that launches a new activity when it's clicked. Here's the code for doing this, using an explicit intent.
public void openOtherActivityClick(View view) { // create an explicit intent and specify // the exact class name of the activity that we want Intent otherActivityIntent = new Intent(this, OtherActivity.class); // start the other activity startActivity(otherActivityIntent); }
With an explicit intent, we specify the exact class name of the activity that we want to start. Another way to start an activity, is with an implicit intent. Here's an example of how to use an implicit intent: http://travisdazell.blogspot.com/2015/01/android-implicit-intents.html
Very informative ..i suggest this blog to my friends..Thank you for sharing
ReplyDeleteAndroid Training | Android Training in chennai | Android Training in chennai with placement