繁体   English   中英

Android-Installing to device using eclipse install two instance of same app once-错误

[英]Android-Installing to device using eclipse install two instance of same app at once-error

Android-Installing to device using eclipse install two instance of same app once-错误

它在使用 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>

我认为问题是因为你重复了

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

这用于 2 个活动。 尝试删除它并仅声明 1 个活动作为您的主要活动。 Tjis 可以解决您的问题。

在活动中尝试此代码并检查它是否有效:

@Override
public void onBackPressed() {
      finish();
      System.exit(0);
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM