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:value=".MainActivity">

after navigation SubActivity crashes crash :
java.lang.IllegalArgumentException: Activity SubActivity does not have a parent activity name specified. (Did you forget to add the <meta-data> element in your manifest?)

But when will prescribe android:value=""
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:value=".MainActivity">

Taken from here.
But when will prescribe android:value=""
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