- Android Application Development Cookbook(Second Edition)
- Rick Boyer Kyle Mew
- 218字
- 2021-07-09 19:36:24
Introduction
The Android OS is an ever-changing environment. The earliest Android devices (prior to Android 3.0), were required to have a hardware menu button. Though a hardware button is no longer required, menus are no less important. In fact, the Menu API has expanded to now support three different types of menus:
- Options Menu and Action Bar: This is the standard menu, which is used for global options of your application. Use this for additional features such as search, settings, and so on.
- Contextual Mode (Contextual Action Mode): This is generally activated by long press. (Think of this as similar to a right-click on the desktop.) This is used to take an action on the pressed item, such as replying to an e-mail or deleting a file.
- Pop-up Menu: This provides a pop-up selection (like a spinner) for an additional action. The menu options are not meant to affect the item pressed, instead use Contextual Mode as described previously. An example would be hitting the share button and getting an additional list of share options.
Menu resources are similar to other Android UI components; they are generally created in XML, but can be created in code as well. Our first recipe, as shown in the following section, will show the XML menu format and how to inflate it.
推薦閱讀
- Boost C++ Application Development Cookbook(Second Edition)
- Python自動化運維快速入門(第2版)
- Python數據結構與算法(視頻教學版)
- Python Data Analysis Cookbook
- Instant Ext.NET Application Development
- PySide 6/PyQt 6快速開發與實戰
- 微信小程序全棧開發技術與實戰(微課版)
- Android項目實戰:手機安全衛士開發案例解析
- Node.js開發指南
- Deep Learning with R Cookbook
- R Data Science Essentials
- 零基礎學Python編程(少兒趣味版)
- QPanda量子計算編程
- Java程序設計基礎(第6版)
- Mastering Concurrency in Python