Android launcher中的一个小错误
我在我的设备上安装我的启动器。如果我一直按home按钮并选择launcher,而不打开我的应用程序,那么一切都正常。然而,当我首先启动我的应用程序,然后按home并选择我的启动器时,它会一次又一次地打开我的应用程序。我该怎么办 我的清单文件:Android launcher中的一个小错误,android,duplicates,launcher,Android,Duplicates,Launcher,我在我的设备上安装我的启动器。如果我一直按home按钮并选择launcher,而不打开我的应用程序,那么一切都正常。然而,当我首先启动我的应用程序,然后按home并选择我的启动器时,它会一次又一次地打开我的应用程序。我该怎么办 我的清单文件: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.comeks.cocuktab"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.comeks.cocuktab.Main"
android:label="@string/app_name"
android:screenOrientation="landscape" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
不确定这是否是您的问题,但请尝试在您的应用程序中: 在舱单中:
<activity
android:noHistory="true"
android:excludeFromRecents="true">
尝试在清单中添加此行
<activity
android:launchMode="singleInstance"
根据您的描述,不清楚发生了什么以及您预期会发生什么。您的应用程序中是否有两个活动,但第二次启动的活动不正确?我安装了我的应用程序。首先,“我不打开应用程序”。我按home键。我选择我的启动器,并设置默认值。没问题。然而,首先,“我打开应用程序”。然后,我按下主页按钮。我的应用程序再次打开。因此,当我退出我的应用程序时,我会看到所有打开的活动。