为一个activity新建一个进程

来源:互联网 发布:mac下制作winpe启动盘 编辑:程序博客网 时间:2024/06/06 08:39

当crash发生时,某个进程已经挂掉,这时候,如果我们想要新启动一个activity去显示本次crash的详情,那么这个activity就不能属于这个crash掉的进程,而应该新建一个进程。为一个activity新建一个进程很简单,只需要在manifest文件中定义一个新的process即可:

   <activity            android:name=".CrashInfoActivity"            android:exported="false"            android:screenOrientation="portrait"            android:process=":crashInfo"            android:theme="@android:style/Theme.Light.NoTitleBar" >        <intent-filter>                <action android:name="com.tmall.wireless.action.navigator.INTERNAL_NAVIGATION" />                <category android:name="com.tmall.wireless.category.navigator.INTERNAL_NAVIGATION" />                <category android:name="android.intent.category.DEFAULT" />                <data                    android:host="page.tm"                    android:path="/crashInfoActivity"                    android:scheme="tmall" />            </intent-filter>        </activity>
0 0