最近碰到這個知識點,以前學的記不清了,記錄下。
步驟如下:
1. 目標app中:允許另外進程啓動此頁面。
<activity android:name=".TestActivity"
android:exported="true"
/>
- 本app中:
Intent intent = new Intent();
//intent.setClassName(包名,頁面名)
intent.setClassName("com.wy.test","com.wy.test.TestActivity");
startActivity(intent);
tips:A應用打開B應用的一個頁面,B應用的進程也相應啓動了。 B應用的這個頁面會保留app中的特性。