final BroadcastReceiver ActionFoundReceiver1 = new BroadcastReceiver(){
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if(BluetoothDevice.ACTION_FOUND.equals(action)) {
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
out = (TextView) findViewById (R.id.deviceName);
out.setText(device.getName());
btDeviceList.add(device);
}
}
}
答案 0 :(得分:0)
你确定调用了onReceive函数吗?尝试在里面打印一些调试文本。
如果被调用,请尝试添加
out = (TextView) findViewById (R.id.deviceName);
out.setText(device.getName());
out.invalidate(); // Add this