android - 安卓应用里组件可以作为单独进程来运行?
黄舟
黄舟 2017-04-17 12:01:23
0
1
622

在安卓官方网站看到这段话:

However, you can arrange for different components in your application to run in separate processes, and you can create additional threads for any process

问:也就是说应用程序里每个组件都可以作为独立的进程来运行?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(1)
巴扎黑

When declaring a component in AndroidManifest.xml, add the process tag and provide the process name, so that this component can be started in another process

// 把activity放在processName1进程
<activity android:name="packageName.xxxActivity" android:process=":processName1" />

// 把receiver放在processName2进程
<receiver android:name="packageName.xxxReceiver" android:process=":processName2" />
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!