Answer the question
In order to leave comments, you need to log in
Strange behavior of NavUtils.navigateUpFromSameTask?
Strange behavior of NavUtils.navigateUpFromSameTask.
If the manifest says
<activity
android:name=".SubActivity"
android:label="@string/title_activity_sub" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
java.lang.IllegalArgumentException: Activity SubActivity 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:178)
...........
android:value="org.domen.app.MainActivity"
Answer the question
In order to leave comments, you need to log in
Maybe it depends on the OS version. Try adding the same parameter to the activity tag
<activity
android:name=".SubActivity"
android:label="@string/title_activity_sub"
android:parentActivityName=".MainActivity">
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity"/>
</activity>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question