android 打开另外一个apk并且传值过去//...... 设置要启动应用程序的包名 与 要启动的ActivityComponentNa
android 打开另外一个apk并且传值过去
//...... 设置要启动应用程序的包名 与 要启动的ActivityComponentName apk2Component = new ComponentName("com.houzhenyu.apk2", "com.houzhenyu.apk2.MainActivity");//................................................... 创建意图与参数对象Intent intent = new Intent();Bundle bundle = new Bundle();//................................................... 传递给apk2的参数bundle.putString("userName", "houzhenyu");bundle.putString("userMail", "goinni@163.com");//................................................... 将参数对象与apk2组件设置给意图intent.putExtras(bundle);intent.setComponent(apk2Component);//................................................... 启动意图,将会打开apk2startActivity(intent); 