0
我是android新手。我正在尝试构建一个应用程序,使我的设备的蓝牙能够发现。 而在代码的这些嵌段:Android应用程序“运行时不幸停止”。错误是没有找到处理意图的活动
public void bTEnableDisable_Discoverable(){
Intent discoverIntent = new Intent(BluetoothAdapter.ACTION_SCAN_MODE_CHANGED);
//discoverIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION,300);
startActivity(discoverIntent);
Log.d(TAG,"scan mode");
IntentFilter intentFilter = new IntentFilter(BluetoothAdapter.ACTION_SCAN_MODE_CHANGED);
registerReceiver(mBroadcastReceiver2,intentFilter);
}
我得到这个错误:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.bluetooth.adapter.action.SCAN_MODE_CHANGED }
谢谢..它工作,我改变它ACTION_REQUEST_DISCOVERABLE – Srijan