在Android中可以通过以下的代码调用其他应用的Activity,
ComponentName componetName = new ComponentName(
//这个是另外一个应用程序的包名
"com.other.app",
//这个参数是要启动的Activity
"com.other.app.TestActivity");
Intent intent= new Intent();
intent.setComponent(componetName);
startActivity(intent);
如果TestActivity在AndroidManifest.xml中的定义包含如下标签,添加如下代码就可以完成调用。
<action android:name="android.intent.action.MAIN" />
如果没有,则需要在TestActivity中添加如下标签android:exported="true"
<activity
android:name="com.other.app.TestActivity"
android:exported="true"
android:label="@string/app_name"
/>