簡體   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