Android-使用eclipse安装到设备一次安装同一个应用程序的两个实例 - 错误
并且它在使用eclipse安装后运行但是当我触摸一次图标时它没有启动它显示我的android常见错误syaing意外停止!请帮帮我??
这是我正在使用的活动(活动)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hunter99x"
android:icon="@drawable/icon"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".main" android:configChanges="orientation|keyboardHidden" android:theme="@android:style/Theme.NoTitleBar"
android:label="@string/app_name" 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=".origine" android:configChanges="orientation|keyboardHidden" android:theme="@android:style/Theme.NoTitleBar"
android:label="@string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.origine" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity `enter code here`android:name=".Gameover" android:configChanges="orientation|keyboardHidden" android:theme="@android:style/Theme.NoTitleBar"
android:label="@string/app_name" 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=".LandingScreen" android:configChanges="orientation|keyboardHidden" android:theme="@android:style/Theme.NoTitleBar"
android:label="@string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.VIBRATE"/>
</manifest>
答案 0 :(得分:1)
我认为问题是因为你重复了
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
这适用于2项活动。尝试删除它并声明只有1个主动作为主要。 Tjis可能会解决您的问题。
答案 1 :(得分:0)
在活动中尝试此代码,并检查它是否有效:
@Override
public void onBackPressed() {
finish();
System.exit(0);
}