Strange behavior NavUtils.navigateUpFromSameTask?

Strange behavior NavUtils.navigateUpFromSameTask.
If the manifest is written
<activity android:name=".SubActivity" android:label="@string/title_activity_sub">
 <meta-data android:name="android.support.PARENT_ACTIVITY" android:value=".MainActivity">
 </meta-data></activity>

after navigation SubActivity crashes crash :
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)
...........</meta-data>

But when will prescribe android:value="org.domen.app.MainActivity"
crash no ...
Although the crash should not be in the first case . Where to dig ?
September 19th 19 at 00:13
1 answer
September 19th 19 at 00:15
It may depend on the version of the OS. Try to add the same parameter to a 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">
 </meta-data></activity>

Taken from here.
But when will prescribe android:value="org.domen.app.MainActivity"
crash no ...
- Niko commented on September 19th 19 at 00:18
If you write starting from the point before it is inserted applicationId. Thus, "applicationId" must match the "package", which is MainActivity. They are the same? - abbigail.Harv commented on September 19th 19 at 00:21

Find more questions by tags AndroidJavaProgramming