0

I have a home/up button in my actionbar, when I click it it works fine in android 4.1.2 but when I use the button on 4.0.3 & 4.2.2 I get this weird error:

FATAL EXCEPTION: main
java.lang.IllegalArgumentException: Activity OrganisationDetail_ does not have a parent activity name specified. (Did you forget to add the android.support.PARENT_ACTIVITY <meta-data>  element in your manifest?)
at android.support.v4.app.NavUtils.navigateUpFromSameTask(NavUtils.java:177)

This is a part of my manifest:

<activity
    android:name="nl.isatis.socialapp.MainActivity_"
    android:label="@string/app_name"
    android:windowSoftInputMode="stateHidden" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

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

<activity
    android:name="nl.isatis.socialapp.OrganisationDetail_"
    android:label="@string/title_activity_organisation_detail"
    android:parentActivityName="nl.isatis.socialapp.MainActivity" >
    <meta-data
        android:name="android.support.PARENT_ACTIVITY"
        android:value="nl.isatis.socialapp.MainActivity" />
</activity>

I use the parent: nl.isatis.socialapp.MainActivity because when I use nl.isatis.socialapp.MainActivity_ It loses the state of the parent activity. But if I use nl.isatis.socialapp.MainActivity_ I don't get this error. I must also note that I use AndroidAnnotations. What am I doing wrong here?

Wesley Egbertsen
  • 720
  • 1
  • 8
  • 25

2 Answers2

0

In the activity tag

Change this

  android:parentActivityName="nl.isatis.socialapp.MainActivity" 

to

   android:parentActivityName="nl.isatis.socialapp.MainActivity_"  

Change this

  android:value="nl.isatis.socialapp.MainActivity"

to

  android:value="nl.isatis.socialapp.MainActivity_"
Raghunandan
  • 132,755
  • 26
  • 225
  • 256
0

I'd say that you've typed the parent activity name wrongly... it should be "MainActivity_" instead of "MainActivity".

Luis
  • 2,833
  • 3
  • 27
  • 41