android 启动应用程序

来源:互联网 发布:跃动冲锋淘宝 编辑:程序博客网 时间:2024/05/16 08:04

启动自己写的应用程序

  1. 前面一个参数是应用程序的包名,后一个是这个应用程序的主Activity名  
  2.  Intent intent=new Intent();  
  3.  intent.setComponent(new ComponentName("com.droidnova.android.games.vortex",   
  4.                                                      "com.droidnova.android.games.vortex.Vortex"));  
  5.  startActivity(intent); 

启动系统自带的应用程序

  1. Intent intent=new Intent();  
  2. intent.setComponent(new ComponentName("com.android.calendar""com.android.calendar.LaunchActivity"));  
  3. startActivity(intent);  
原创粉丝点击