开发者

Is it possible to start a Activity as a new process

开发者 https://www.devze.com 2023-03-07 01:18 出处:网络
I have this situation where i have to start an activity开发者_JAVA技巧 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

I have this situation where i have to start an activity开发者_JAVA技巧 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.


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>

In this case "YourActivity" will be run on other process called "YourProcessName".

0

精彩评论

暂无评论...
验证码 换一张
取 消