android 蓝牙连接问题
createBond(Class<?> btClass,BluetoothDevice btDevice) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException{
Method createBondMethod = btClass.getMethod("createBond");
Boolean returnValue = (Boolean) createBondMethod.invoke(btDevice);
return returnValue.booleanValue();
上面代码为自动配对代码
createBondMethod.invoke(btDevice) 处报错 异常为 InvocationTargetException