TAILIEUCHUNG - Beginning Android PHẦN 10

với một tên của Android Android. và Android: giá trị của một nguồn tài nguyên XML có chứa thêm thông tin về các thiết bị tìm kiếm được cung cấp bởi hoạt động nàyvì vậy ý định tìm kiếm sẽ được chọn. 3. Hoạt động LoremSearch được thiết lập để có android: launchMode = "singleTop" | 320 CHAPTER 36 SEARCHING WITH SEARCHMANAGER meta-data android name android resource @xml searchable activity application manifest The changes needed are as follows 1. The LoremDemo main activity gets a meta-data element with an android name of android. and a android value of the search implementation class .LoremSearch . 2. The LoremSearch activity gets an intent filter for so search intents will be picked up. 3. The LoremSearch activity is set to have android launchMode singleTop which means at most one instance of this activity will be open at any time so we don t wind up with a whole bunch of little search activities cluttering up the activity stack. 4. The LoremSearch activity gets a meta-data element with an android name of android. and a android value of an XML resource containing more information about the search facility offered by this activity @xml searchable . searchable xmlns android http apk res android android label @string searchLabel android hint @string searchHint That XML resource provides two bits of information today What name should appear in the search domain button to the right of the search field identifying to the user where they are searching android label What hint text should appear in the search field to give the user a clue as to what they should be typing in android hint Searching for Meaning in Randomness Given all that search is now available Android knows your application is searchable and what search domain to use when searching from the main activity and the activity knows how to do the search. The options menu for this application has both local and global search options. In the case of local search we just call onSearchRequested in the case of global search we call startSearch with true in the last parameter indicating the scope is global. Typing in a letter or two then clicking Search will bring up the search activity

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.