It prompts the user to turn on Bluetooth and asks for confirmation. If dịch - It prompts the user to turn on Bluetooth and asks for confirmation. If Việt làm thế nào để nói

It prompts the user to turn on Blue

It prompts the user to turn on Bluetooth and asks for confirmation. If the user agrees, the sub¬Activity will close and return to the calling Activity when the Bluetooth Adapter has turned on (or has encountered an error). If the user selects no, the sub-Activity will close and return immediately. Use the result code parameter returned in the onActivityResult handler to determine the success of this operation, as shown in Listing 16-2.

code snippet PA4AD_Ch16_Bluetooth/src/BluetoothActivity.java
Enabling and disabling the Bluetooth Adapter are somewhat time-consuming, asynchronous opera¬tions. Rather than polling the Bluetooth Adapter, your application should register a Broadcast Receiver that listens for action_state_changed. The Broadcast Intent will include two extras, extra_state and extra_previous_state, which indicate the current and previous Bluetooth Adapter states, respectively:
BroadcastReceiver bluetoothState = new BroadcastReceiver() {
©Override
public void onReceive(Context context, Intent intent) {
String prevStateExtra = BluetoothAdapter.EXTRA_PREVI0US_STATE;
String stateExtra = BluetoothAdapter.EXTRA_STATE;
int state = intent.getIntExtra(stateExtra, -1);
int previousState = intent.getIntExtra(prevStateExtra, -1);
String tt = ""; switch (state) {
case (BluetoothAdapter.STATE_TURNING_0N) : tt = "Bluetooth turning on"; break; case (BluetoothAdapter.STATE_0N) :
0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
It prompts the user to turn on Bluetooth and asks for confirmation. If the user agrees, the sub¬Activity will close and return to the calling Activity when the Bluetooth Adapter has turned on (or has encountered an error). If the user selects no, the sub-Activity will close and return immediately. Use the result code parameter returned in the onActivityResult handler to determine the success of this operation, as shown in Listing 16-2. code snippet PA4AD_Ch16_Bluetooth/src/BluetoothActivity.javaEnabling and disabling the Bluetooth Adapter are somewhat time-consuming, asynchronous opera¬tions. Rather than polling the Bluetooth Adapter, your application should register a Broadcast Receiver that listens for action_state_changed. The Broadcast Intent will include two extras, extra_state and extra_previous_state, which indicate the current and previous Bluetooth Adapter states, respectively:BroadcastReceiver bluetoothState = new BroadcastReceiver() {©Overridepublic void onReceive(Context context, Intent intent) {String prevStateExtra = BluetoothAdapter.EXTRA_PREVI0US_STATE;String stateExtra = BluetoothAdapter.EXTRA_STATE;int state = intent.getIntExtra(stateExtra, -1);int previousState = intent.getIntExtra(prevStateExtra, -1);String tt = ""; switch (state) {case (BluetoothAdapter.STATE_TURNING_0N) : tt = "Bluetooth turning on"; break; case (BluetoothAdapter.STATE_0N) :
đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
Nó nhắc nhở người dùng bật Bluetooth và yêu cầu xác nhận. Nếu người dùng đồng ý, sub¬Activity sẽ đóng cửa và trở về Hoạt động gọi khi Adapter Bluetooth đã bật (hoặc đã gặp phải một lỗi). Nếu người sử dụng chọn không, tiểu Hoạt động sẽ đóng cửa và trở về ngay lập tức. Sử dụng các tham số mã kết quả trở lại trong xử lý onActivityResult để xác định sự thành công của hoạt động này, như thể hiện trong Liệt kê 16-2. Đoạn mã PA4AD_Ch16_Bluetooth / src / BluetoothActivity.java Việc kích hoạt và vô hiệu hóa Adapter Bluetooth là hơi tốn thời gian, opera¬ không đồng bộ tions. Thay vì bỏ phiếu Adapter Bluetooth, ứng dụng của bạn nên đăng ký một Receiver Broadcast mà nghe cho action_state_changed. Các Ý định phát sóng sẽ bao gồm hai tính năng bổ sung, extra_state và extra_previous_state, trong đó chỉ ra các trạng thái Bluetooth Adapter hiện tại và trước đó, tương ứng: BroadcastReceiver bluetoothState = new BroadcastReceiver () { © Override public void onReceive (bối cảnh bối cảnh, ý định Ý định) { string prevStateExtra = BluetoothAdapter. EXTRA_PREVI0US_STATE; Chuỗi stateExtra = BluetoothAdapter.EXTRA_STATE; int state = intent.getIntExtra (stateExtra, -1); int previousState = intent.getIntExtra (prevStateExtra, -1); Chuỗi tt = ""; switch (nhà nước) { case (BluetoothAdapter.STATE_TURNING_0N): tt = "Bluetooth bật"; phá vỡ; trường hợp (BluetoothAdapter.STATE_0N):












đ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 ©2024 I Love Translation. All reserved.

E-mail: