【发布时间】:2014-01-15 05:53:55
【问题描述】:
我使用了 android:launchMode="singleInstance",它停止创建应用程序的另一个实例,同时保留第一个实例。
这是我的活动配置信息
<activity
android:name="com.abc.SplashActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/Theme.ABC"
>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="192.168.0.52"
android:scheme="http" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
【问题讨论】:
-
你声称用过,但你的配置好像没有!
-
这就是我正在使用的!它是从一些外部源链接启动时可调试的吗? if (!isTaskRoot()) { final Intent intent = getIntent();最终字符串 intentAction = intent.getAction(); if (intent.hasCategory(Intent.CATEGORY_DEFAULT)&&intent.hasCategory(Intent.CATEGORY_BROWSABLE) && intentAction != null && intentAction.equals(Intent.ACTION_VIEW)) { finish(); } }
标签: android process state launching-application android-launcher