This approach is particularly useful for reacting to system, user, or  dịch - This approach is particularly useful for reacting to system, user, or  Việt làm thế nào để nói

This approach is particularly usefu

This approach is particularly useful for reacting to system, user, or application events — like a data refresh, or a user action such as clicking buttons on the Widget itself. You can also register for system event broadcasts such as changes to network connectivity, battery level, or screen brightness. By relying on existing events to trigger UI updates, you minimize the impact of Widget updates while maintaining a fresh UI.
You can also leverage this technique to trigger an update of your Widget at any time by broadcast¬ing an Intent using the action specified in your Intent Filter, as shown in Listing 14-15.
Using Alarms
Alarms, covered in detail in Chapter 9, “Working in the Background,” provide a flexible way to schedule regular events within your application. Using Alarms, you can poll at regular intervals using the Intent-based update technique described in the previous section to trigger regular Widget updates.
Unlike the minimum refresh rate, Alarms can be configured to trigger only when the device is already awake, providing a more efficient alternative when regular updates are required.
Using Alarms to refresh your Widgets is similar to using the Intent-driven model described previ¬ously. Add a new Intent Filter to the manifest entry for your Widget, and override its onReceive method to identify the Intent that triggered it. Within your application, use the Alarm Manager to create an Alarm that fires an Intent with the registered action.
Like the minimum update rate, Alarms can be set to wake the device when they trigger — making it important to minimize their use to conserve battery life.
One alternative is to use either the RTC or ELAPSED_REALTIME modes when constructing your Alarm. These modes configure an Alarm to trigger at a set time or after a specified interval has elapsed, but only if the device is awake. 
Listing 14-16 shows how to schedule a repeating Alarm that broadcasts an Intent used to force a Widget update.


0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
This approach is particularly useful for reacting to system, user, or application events — like a data refresh, or a user action such as clicking buttons on the Widget itself. You can also register for system event broadcasts such as changes to network connectivity, battery level, or screen brightness. By relying on existing events to trigger UI updates, you minimize the impact of Widget updates while maintaining a fresh UI.You can also leverage this technique to trigger an update of your Widget at any time by broadcast¬ing an Intent using the action specified in your Intent Filter, as shown in Listing 14-15.Using AlarmsAlarms, covered in detail in Chapter 9, “Working in the Background,” provide a flexible way to schedule regular events within your application. Using Alarms, you can poll at regular intervals using the Intent-based update technique described in the previous section to trigger regular Widget updates.Unlike the minimum refresh rate, Alarms can be configured to trigger only when the device is already awake, providing a more efficient alternative when regular updates are required.Using Alarms to refresh your Widgets is similar to using the Intent-driven model described previ¬ously. Add a new Intent Filter to the manifest entry for your Widget, and override its onReceive method to identify the Intent that triggered it. Within your application, use the Alarm Manager to create an Alarm that fires an Intent with the registered action.Like the minimum update rate, Alarms can be set to wake the device when they trigger — making it important to minimize their use to conserve battery life.One alternative is to use either the RTC or ELAPSED_REALTIME modes when constructing your Alarm. These modes configure an Alarm to trigger at a set time or after a specified interval has elapsed, but only if the device is awake. Listing 14-16 shows how to schedule a repeating Alarm that broadcasts an Intent used to force a Widget update.
đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
Cách tiếp cận này đặc biệt hữu ích cho phản ứng với hệ thống, người sử dụng, hoặc các sự kiện ứng dụng - như một làm mới dữ liệu, hoặc dùng hành động như nhấn nút trên Widget chính nó. Bạn cũng có thể đăng ký cho chương trình phát sóng sự kiện hệ thống như thay đổi mạng lưới kết nối, mức độ pin, độ sáng màn hình. Bằng cách dựa vào các sự kiện hiện có để kích hoạt giao diện người dùng cập nhật, bạn giảm thiểu các tác động của thông tin cập nhật Widget trong khi duy trì một giao diện người dùng mới mẻ.
Bạn cũng có thể tận dụng kỹ thuật này để kích hoạt cập nhật các Widget của bạn bất cứ lúc nào bởi broadcast¬ing Intent sử dụng các hành động cụ thể trong Bộ lọc của bạn Ý định, như thể hiện trong Liệt kê 14-15.
Sử dụng Báo động
Báo động, trình bày chi tiết trong chương 9, "làm việc trong nền," cung cấp một cách linh hoạt để lên lịch sự kiện thường xuyên trong phạm vi ứng dụng của bạn. Sử dụng Báo động, bạn có thể thăm dò ý kiến tại các khoảng thường xuyên sử dụng kỹ thuật cập nhật Ý định dựa trên mô tả trong phần trước để kích hoạt cập nhật Widget thường xuyên.
Không giống như tốc độ làm tươi tối thiểu, Báo động có thể được cấu hình để kích hoạt chỉ khi thiết bị đã tỉnh táo, cung cấp hơn thay thế hiệu quả khi cập nhật thường xuyên được yêu cầu.
sử dụng Báo động để làm mới Widgets của bạn là tương tự như sử dụng mô hình Ý định hướng mô tả previ¬ously. Thêm một bộ lọc Ý định mới về nhập cảnh manifest cho Widget của bạn, và ghi đè phương pháp onReceive của nó để xác định ý định đó kích hoạt nó. Trong ứng dụng của bạn, sử dụng Quản lý báo động để tạo ra một cảnh báo rằng đám cháy một Intent với các hành động đã đăng ký.
Giống như tốc độ cập nhật tối thiểu, Báo động có thể được thiết lập để đánh thức các thiết bị khi họ kích hoạt - làm cho nó quan trọng để giảm thiểu việc sử dụng chúng để tiết kiệm pin .
Một cách khác là sử dụng một trong hai chế độ RTC hoặc ELAPSED_REALTIME khi xây dựng báo thức của bạn. Các chế độ cấu hình báo động để kích hoạt một thời gian đặt hoặc sau một khoảng thời gian quy định đã trôi qua, nhưng chỉ nếu thiết bị là tỉnh táo. 
Liệt 14-16 cho thấy làm thế nào để sắp xếp một báo động lặp đi lặp lại rằng chương trình phát sóng một Intent sử dụng để buộc một bản cập nhật Widget.


đang được dịch, vui lòng đợi..
 
Các ngôn ngữ khác
Hỗ trợ công cụ dịch thuật: Albania, Amharic, Anh, Armenia, Azerbaijan, Ba Lan, Ba Tư, Bantu, Basque, Belarus, Bengal, Bosnia, Bulgaria, Bồ Đào Nha, Catalan, Cebuano, Chichewa, Corsi, Creole (Haiti), Croatia, Do Thái, Estonia, Filipino, Frisia, Gael Scotland, Galicia, George, Gujarat, Hausa, Hawaii, Hindi, Hmong, Hungary, Hy Lạp, Hà Lan, Hà Lan (Nam Phi), Hàn, Iceland, Igbo, Ireland, Java, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Kurd, Kyrgyz, Latinh, Latvia, Litva, Luxembourg, Lào, Macedonia, Malagasy, Malayalam, Malta, Maori, Marathi, Myanmar, Mã Lai, Mông Cổ, Na Uy, Nepal, Nga, Nhật, Odia (Oriya), Pashto, Pháp, Phát hiện ngôn ngữ, Phần Lan, Punjab, Quốc tế ngữ, Rumani, Samoa, Serbia, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenia, Somali, Sunda, Swahili, Séc, Tajik, Tamil, Tatar, Telugu, Thái, Thổ Nhĩ Kỳ, Thụy Điển, Tiếng Indonesia, Tiếng Ý, Trung, Trung (Phồn thể), Turkmen, Tây Ban Nha, Ukraina, Urdu, Uyghur, Uzbek, Việt, Xứ Wales, Yiddish, Yoruba, Zulu, Đan Mạch, Đức, Ả Rập, dịch ngôn ngữ.

Copyright ©2025 I Love Translation. All reserved.

E-mail: