是否有可能开始一个活动作为一个新的进程 [英] Is it possible to start a Activity as a new process
本文介绍了是否有可能开始一个活动作为一个新的进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这样的情况下,我必须从我的mainActivity开始活动。但是,我希望这个新的活动将开始作为一个新的进程(使用新进程ID)。是否有可能在Android的实现这一目标。
任何帮助是AP preciated。
I have this situation where i have to start an activity from my mainActivity. But I want this new activity to be started as a new process(With new process ID). Is it possible to achieve this in android. Any help is appreciated.
推荐答案
只要把安卓过程=:ProcessName作为您的活动在AndroidManifest.xml
Just put android:process=":ProcessName" for your Activity in AndroidManifest.xml
<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>
在这种情况下,YourActivity将在名为YourProcessName等过程中运行。
In this case "YourActivity" will be run on other process called "YourProcessName".
这篇关于是否有可能开始一个活动作为一个新的进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文