Are the 4 Android buttons standard? Ex. back button, menu button

后端 未结 4 1632
没有蜡笔的小新
没有蜡笔的小新 2020-12-17 09:57

Are the physical buttons that Android phones come with standard? Specifically the back, menu, home, and search button? In my applications I assume everyone has a back button

4条回答
  •  生来不讨喜
    2020-12-17 10:36

    I haven't been able to find any definitive answer one way or another. However, the documentation assumes there will always be a Back key that the OS responds to:

    As the user moves from activity to activity, across applications, the Android system keeps a linear navigation history of activities the user has visited. This is the activity stack, also known as the back stack. In general, when a user starts a new activity, it is added to the activity stack, so that pressing BACK displays the previous activity on the stack. However, the user cannot use the BACK key to go back further than the last visit to Home. The adding of an activity to the current stack happens whether or not that activity begins a new task (as long as that task was started without going Home), so going back can let the user go back to activities in previous tasks. The user can get to tasks earlier than the most recent Home by selecting its root activity from the application launcher, a shortcut, or the "Recent tasks" screen.

    Activities are the only things that can be added to the activity stack — views, windows, menus, and dialogs cannot. That is, when designing the navigation, if you have screen A and you want the user to be able go to a subsequent screen B and then use the BACK key to go back to screen A, then the screen A needs to be implemented as an activity. The one exception to this rule is if your application takes control of the BACK key and manages the navigation itself.

    From http://developer.android.com/guide/practices/ui_guidelines/activity_task_design.html

    Based on that, I would say it is safe to assume that there will always be a physical Back key.

提交回复
热议问题