简体   繁体   中英

DisplayMessageActivity back button keeps crashing my android application

The default back button that appears next to the icon in the action bar crashes when i try to return to MainActivity . MainActivity calls DisplayMessageActivity from there I click the default back button and the app crashes.

Logs show message:

E/AndroidRuntime(24509): java.lang.IllegalArgumentException: Activity DisplayMessageActivity does not have a parent activity name specified. (Did you forget to add the android.support.PARENT_ACTIVITY <meta-data>  element in your manifest?)

Here is my manifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.assemblyx.playzone"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="11"
    android:targetSdkVersion="18" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="net.assemblyx.playzone.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="net.assemblyx.playzone.DisplayMessageActivity"
        android:label="@string/title_activity_display_message"
        android:parentActivityName="net.assemblyx.playZone.MainActivity" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="net.assemblyx.playZone.MainActivity" />
    </activity>
</application>

包名称有playZone,应该是playzone

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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