Method One:Intent Intent = new Intent ();
- intent.setclassname (<package< Span style= "color:black;" > name>, <class name>);
- StartActivity (Intent);
Method Two:
- Intent i=new Intent;
- ComponentName com= New componentname (<package name>, <calss name>);
- I.setcomponent (COM);
- StartActivity (i);
Start the Media Library
Intent i = new Intent ();
ComponentName comp = new ComponentName ("Com.android.camera", "Com.android.camera.GalleryPicker");
I.setcomponent (comp);
I.setaction ("Android.intent.action.VIEW");
StartActivity (i);
Start the camera
Intent mintent = new Intent ();
ComponentName comp = new ComponentName ("Com.android.camera", "Com.android.camera.Camera");
Mintent.setcomponent (comp);
Mintent.setaction ("Android.intent.action.VIEW");
StartActivity (mintent);
Start Htmlviewer and open the specified file note that TXT cannot be ANSI, otherwise it will be garbled
Intent Intent = new Intent ();
ComponentName cn = New ComponentName ("Com.android.htmlviewer", "com.android.htmlviewer.HTMLViewerActivity");
Intent.setcomponent (CN);
Uri uri = uri.fromfile (New File ("/sdcard/demo.txt"));
Intent.setdataandtype (URI, "Text/plain");
StartActivity (Intent);
Android launch code for third-party programs