![]() When you press the back button, the current activity (the current screen displayed to the user) is destroyed, and the activity at the top of the back stack is popped off and displayed to the user. As you navigate from one activity to another, the previous activity is pushed onto the stack. The elements in the stack are the screens of an app, called activities. The back stack can seem complicated at first, but its implementation is firmly rooted in basic computer science. Pressing back from the map will take the user back to the original app.Įach Android task has an associated back stack. For example, if you navigate from an existing app to the Google Maps app, the displayed map will be part of the existing app task. Instead, the new activity becomes part of the existing task. Moving from one application to another generally doesn't start a new task. A new task is created when the user opens an application from the launcher. Tasks are collections of activities opened in chronological order by the user. Understand How Tasks Relate to the Back Stack Once the user reaches the launcher, he can no longer press back. As a user navigates through an app and into others, the back button will take him backward through those activities, until he reaches the launcher. Think of it like the browser's back button. This is limited to those activities in the current task (more about that in a moment). The back button, on the other hand, moves back through the stack of recent activities. If no parent exists, up should take the user to the "home" activity of your app. In the Gmail app, for example, pressing the up button while viewing an email message would take you to a list of email messages. In addition, the concept of up means that the user will return to a "logical" parent of the current activity. It will never take the user to a different application. First, the up button is only relevant within your app. It's important to understand the differences between the up and the back button. It also includes an icon on the left side that can be used as an up button (see Figure 1).įigure 1 The up button as displayed in the Google Play app. ![]() This bar sits at the top of the screen and contains common actions and navigation elements, such as tabs. Learn the Difference Between Up and BackĪndroid version 3.0 introduced a standardized navigation element called the ActionBar. In addition, you should understand the basics of tasks and the back stack to leverage Android effectively. ![]() You should read both of these resources and think carefully about your own application and how you expect people to use it. In particular, the design guidelines and navigation training article provide clear case studies, working through the high-level application use case and following through with individual screens and the actions of the back and up buttons. Luckily, Google has recently addressed this problem, and now there are many resources explaining how to navigate an Android app. Learn from the Android Documentationįor many years, the Android documentation on navigation has been lacking. To address this issue, this article presents seven tips for proper implementation of navigation in your Android app. Many apps fail to handle the nuances of activities and tasks properly, forcing users to endure endless back pressing to exit an app. However, one area where developers still seem to struggle is with Android's navigation model. ![]() As its user base increases, so do the number and quality of apps in the Google Play store. ![]() Android UI Fundamentals: Develop & DesignĪndroid development has exploded in recent years, making Android the largest smartphone OS by market share. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |