我有这种情况,我必须从我的mainActivity开始一个活动.但我希望这个新活动作为一个新进程启动(使用新进程ID).是否有可能在Android中实现这一点.任何帮助表示赞赏.
val*_*dak 19
只需在AndroidManifest.xml中为您的Activity添加android:process =":ProcessName"即可
<activity
android:name=".YourActivity"
android:screenOrientation="portrait"
android:process=":YourProcessName">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
在这种情况下,"YourActivity"将在名为"YourProcessName"的其他进程上运行.