In your application that contains more than one activity, it is a good idea to provide up navigation from an activity to its parent activity. By doing this, your application provides better user experience. This Android shows how to achieve this goal.
To provide the up navigation in an activity, first you need to declare its parent activity in the AndroidManifest.xml file. By doing so, the system can look up the parent activity in the AndroidManifest.xml file. If your application target Android 4.1 or higher, you can declare the parent activity using the android:parentActivityName attribute in the <activity> element. If your application supports Android 4.0 or lower, you need to add a <meta-data>element inside activity. Then assign android.support.PARENT_ACTIVITY to the android:name and the parent activity (as specified with the android:parentActivityName attribute) to the android:value attribute.
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Posted by: Dara | post date: 10-09-2014 | Subject: Android Apps Development
This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages: