Why does the up button cause an exception in the 'Building Your First App' Android training
android
Solution
It turns out that I had made a simple mistake, I had got the namespace wrong.
Used in the training: com.example.myfirstapp What I used: com.example.myfirstname
For some reason I had used a different name than the training so when I copied and pasted from the last part it included the original name. I hindsight I should have read the error message a bit more carefully and I should have realised my mistake.
The part 'Did you forget to add the android.support.PARENT_ACTIVITY' throw me off a bit since that section was included it was just using the wrong namespace.
Problem
I had done all of the steps on the last part (Starting Another Activity) and it does display the message on the second activity but when I click the up button it throws the exception below, I've included the whole error section from the LogCat window. I've tried searching online for 'bad parentActivityName' or 'does not have a parent activity name specified' but I couldn't find any clear information or anything related to the training. ``` E/Activity(17099): getParentActivityIntent: bad parentActivityName 'com.example.myfirstapp.MainActivity' in manifest E/NavUtils(17099): getParentActivityIntent: bad parentActivityName 'com.example.myfirstapp.MainActivity' in manifest D/AndroidRuntime(17099): Shutting down VM E/AndroidRuntime(17099): FATAL EXCEPTION: main E/AndroidRuntime(17099): 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?) E/AndroidRuntime(17099): at android.support.v4.app.NavUtils.navigateUpFromSameTask(NavUtils.java:177) E/AndroidRuntime(17099): at com.example.myfirstname.DisplayMessageActivity.onOptionsItemSelected(DisplayMessageActivity.java:55) E/AndroidRuntime(17099): at android.app.Activity.onMenuItemSelected(Activity.java:2548) E/AndroidRuntime(17099): at com.android.internal.widget.ActionBarView$3.onClick(ActionBarView.java:167) E/AndroidRuntime(17099): at android.view.View.performClick(View.java:4204) E/AndroidRuntime(17099): at android.view.View$PerformClick.run(View.java:17355) E/AndroidRuntime(17099): at android.os.Handler.handleCallback(Handler.java:725) E/AndroidRuntime(17099): at android.os.Handler.dispatchMessage(Handler.java:92) E/AndroidRuntime(17099): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime(17099): at android.app.ActivityThread.main(ActivityThread.java:5041) E/AndroidRuntime(17099): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(17099): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime(17099): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) E/AndroidRuntime(17099): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) E/AndroidRuntime(17099): at dalvik.system.NativeStart.main(Native Method) ```