开发者

Should I provide an explicit back button in my view?

开发者 https://www.devze.com 2023-04-07 00:22 出处:网络
When an application has开发者_运维问答 a single view, the Back button probably resumes whatever previous application was running/suspended. I\'m tempted to provide an explicit button which says \'Back

When an application has开发者_运维问答 a single view, the Back button probably resumes whatever previous application was running/suspended. I'm tempted to provide an explicit button which says 'Back' right there on the UI ...

Should I provide an explicit back button in my view, or should I simply override the navigation button provided by the OS? My gut says the latter would be counter-intuitive. Are there any recommendations on this by the android community?


That entirely depends on your application. Normally, your application is made out of multiple activities (Activity objects), and the back button will go to the previous activity.

So if your app has a main menu (activity A), which has a button to go to search (activity B), which will lead to search results (activity C), then pressing the back button on the search page gets you back to the main menu. This is fully automatic, you don't need to write anything for this to work.

That's how Android works, and that's how you should write your app. All Android devices have a device button (physical or on-screen, in case of Honeycomb), so don't waste precious screen real estate on a "back button". Don't be like the iPhone.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号