DisplayMessageActivity后退按钮不断崩溃我的Android应用程序

时间:2014-03-01 17:11:11

标签: java android android-manifest

当我尝试返回MainActivity时,操作栏中图标旁边显示的默认后退按钮崩溃。 MainActivity从那里调用DisplayMessageActivity我点击默认后退按钮,应用程序崩溃。

日志显示消息:

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?)

这是我的清单:

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

1 个答案:

答案 0 :(得分:1)

包名称有playZone,应该是playzone