The more visual prompts a user has, the more successful they'll be using your app. In this video, learn how to add an "Up" button that finishes an activity and returns to its parent.
- [Instructor] The more visual prompts a user has, … the more successful they'll be using your app. … It's common to display a button at the top corner … of a secondary activity that the user can press … to return to the activity's parent. … And it takes just a single line of code to display … a default image, an arrow pointing to the edge that when … pressed will return to the parent activity. … I'm in the dice activity class and I'll add this code … after the call to set support action bar. … I'll start with a reference to the action bar object, … support action bar question mark because it's a nullible … object and then I'll call this function with the very … long name. … Set display home as up enabled, and I'll pass in a boolean … value of true. … And now when I run the application and I press … the rolling button to go to the secondary activity, … I see the up button. … It's actually an arrow pointing to the side. … And when I press it, I go back to the parent activity. … If you want to use a different graphic, you can add …
Looking for study partners?Join the Associate Android Developer Exam study group
The Android app architecture constantly evolves. The introduction of the Kotlin programming language, new form factors such as Chromebooks, and reusable architecture components have made it faster and easier than ever to build high-quality Android apps. It is imperative that developers understand what the latest tools and recommendations are and how to use them to build out their applications. In this course, instructor David Gassner explains how to build an Android app that uses Kotlin instead of Java, add navigation functionality, and leverage the most useful architecture components such as LifecycleObserver, ViewModel, and LiveData, to create apps that are robust and easy to maintain over time.
- Handling lifecycle events
- Handling view events
- Updating display from new data
- Adding ViewModels to activities
- Subscribing to changes in LiveData values
- Adding a new launcher activity
- Starting activities with explicit intents
- Sharing data with implicit intents
- Adding a navigation drawer
- Adding a header to a navigation drawer
- Handling navigating drawer menu events