您的位置:首页 > 移动开发 > Android开发

android:process用于在新进程中启动Activity

2016-07-21 14:06 489 查看
在AndroidMenifest.xml文件中使用android:process可以在新进程中启动Activity

        <activity android:name="cn.sinonet.uhome.ui.Loading"

            android:label="@string/app_name" android:process=":process.main"

            android:screenOrientation="portrait">

            <intent-filter>

                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />

            </intent-filter>

        </activity>

        <activity android:name="com.haier.uhome.videointercom.ui.HaierCommonAct"

            android:icon="@drawable/uhome" android:label="可视对讲"

            android:launchMode="singleInstance" android:process=":process.sub">

            <intent-filter>

                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />

            </intent-filter>

        </activity>

在两个Activity的IntentFilter都设定为action.MAIN和category.LAUNCHER 安装以后在桌面会出现两个应用图标
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: