TAILIEUCHUNG - Lập trình Androi part 17

Cũng giống như các ứng dụng cho máy tính để bàn và hệ điều hành một số điện thoại di động, chẳng hạn như Windows Mobile, Android hỗ trợ hoạt động với các menu ứng dụng. Trong Android, điều này được gọi là một trình đơn tùy chọn. Một số điện thoại Android sẽ có một phím dành riêng cho popping lên menu tùy chọn, người khác sẽ cung cấp phương tiện thay thế để kích hoạt trình đơn xuất hiện, chẳng hạn như các nút trên màn hình được sử dụng bởi các viên thuốc Archos 5 Android | Chapter Applying Menus Like applications for the desktop and some mobile operating systems such as Windows Mobile Android supports activities with application menus. In Android this is called an options menu. Some Android phones will have a dedicated key for popping up the options menu others will offer alternate means for triggering the menu to appear such as the on-screen button used by the Archos 5 Android tablet. Also as with many GUI toolkits you can create context menus for your Android applications. On mobile devices context menus typically appear when the user taps and holds over a particular widget. For example if a TextView had a context menu and the device was designed for finger-based touch input you could push the TextView with your finger hold it for a second or two and a pop-up menu would appear. This chapter describes how to work with Android options and context menus. Menus of Options The options menu is triggered by pressing the hardware Menu button on the device. This menu operates in one of two modes icon and expanded. When the user first presses the Menu button the icon mode will appear showing up to the first six menu choices as large finger-friendly buttons in a grid at the bottom of the screen. If the menu has more than six choices the sixth button will be labeled More. Choosing the More option will bring up the expanded mode showing the remaining choices not visible in the regular menu. The menu is scrollable so the user can get to any of the menu choices. Creating an Options Menu Rather than building your activity s options menu during onCreate the way you wire up the rest of your UI you instead need to implement onCreateOptionsMenu . This callback receives an instance of Menu. 125 CHAPTER 11 Applying Menus The first thing you should do is chain upward to the superclass menu so the Android framework can add in any menu choices it feels are necessary. Then you can go about adding your own options as described in .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.