【发布时间】:2015-08-24 07:30:56
【问题描述】:
我想访问包含在 BluetoothDevice.ACTION_FOUND 中的额外内容,例如,如果我想访问包含在 BluetoothDevice.EXTRA_CLASS 中的值,我应该使用它,如下面的代码所示,但是当我显示变量“状态”,类似于 -245175
BluetoothDevice.EXTRA_CLASS 中是否还有其他值?我应该怎么认识他们?我应该如何访问它们?
更新:
我注册的意图是:BluetoothDevice.ACTION_FOUND
代码:
switch (action) {
case BluetoothDevice.ACTION_FOUND:
Log.d(TAG, LogAnd.i("onReceive", "BluetoothDevice.ACTION_FOUND"));
final int state = intent.getIntExtra(BluetoothDevice.EXTRA_CLASS, BluetoothAdapter.ERROR);
Log.d(TAG, LogAnd.i("onReceive", "state: "+state));
break;
【问题讨论】:
标签: android android-intent broadcastreceiver intentfilter extras