我有一个简短的问题.如何在不使用AsyncTask的情况下更新TextField?在我的Activity类中,我有一个这样的函数:
private void CheckBlueToothState(){
if (bluetoothAdapter == null){
status.setText("Bluetooth NOT support.");
}else{
if (bluetoothAdapter.isEnabled()){
if(bluetoothAdapter.isDiscovering()){
status.setText("Bluetooth is currently in device discovery process.");
}else{
status.setText("Bluetooth is Enabled");
search.setEnabled(true);
}
}else{
status.setText("Bluetooth is NOT Enabled");
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
}
}
}
Run Code Online (Sandbox Code Playgroud)
哪个检查设备是否有蓝牙,启用或禁用,你希望得到的图片.所以再次提出我的问题.status如果我关闭蓝牙,如何动态更改文本字段,反之亦然?
| 归档时间: |
|
| 查看次数: |
131 次 |
| 最近记录: |