To start another activity, you can have methods useful setclass () and component Name
1. Let's start with an activity method in SetClass:
Intent Intent = new Intent ();
Intent.setclass (this, createplaylist.class)//parameter one for the current package context,t the current activity context is this, Other package may use the Createpackagecontex () parameter two for the class name of the activity you want to open
StartActivity (Intent);
2. The way to open by component name
Intent Intent = new Intent ();
Intent.setaction (Intent.action_main); Add some features to see the intent document, the related properties of the introduction
Intent.addcategory (Intent.category_launcher);
Intent.setflags (Intent.flag_activity_new_task | intent.flag_activity_reset_task_if_needed);
Pass some data through the bundle to the activity to be opened
Bundle bundle = new bundle ();
Bundle.putstring ("Data", New String ("Hello World");
Intent.putextras (bundle);
Intent.setcomponent (New ComponentName (
New String ("Com.android.testActivity"), new String ("com.android.testActivity.testActivity"));
StartActivity (Intent);
Starting from scratch Android development-how to start activity with intent