方法一
Intent intent = new Intent();  intent.setClassName(<package name>, <class name>);  startActivity(intent);
Intent i=new Intent;ComponentName com= new ComponentName(<Package Name> , <Calss Name>);  i.setComponent(com);  startActivity(i);  
 
 
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);//启动相机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);//启动htmlviewer,并打开指定的一个文件 注意TXT不能是ANSI的,否则会乱码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);

更多相关文章

  1. Android(安卓)Wifi模块分析(三)
  2. Android(安卓)Activity的启动
  3. Android(安卓)命令行编译、打包生成apk文件
  4. Android(安卓)任务和回退堆栈---启动任务
  5. Android——Activity四种启动模式
  6. 修复Android(安卓)App在开机后入口类被启动两次的bug
  7. android 命令(adb shell)进入指定模拟器或设备
  8. Android(安卓)开机自启动程序
  9. Android(安卓)ASE 脚本环境

随机推荐

  1. android的核心竞争力
  2. sdk 命令
  3. Android学习笔记:Android基础知识总结
  4. 解决Android 9 无法连接网络问题
  5. Android(安卓)上的低功耗蓝牙实践
  6. MPAndroidChart项目实战(五)——MPAndroidC
  7. 【Android】android的基本UI操作(1)
  8. Android Studio精彩案例(七)《ToolBar使
  9. Android之Http通信
  10. Android 开发简介