http://blog.youkuaiyun.com/annkie/article/details/8466654
public void a2dpConnect(BluetoothDevice device) {
Logg.i(SPPService.TAG, "a2dpConnect");
if (a2dpProfile != null && device != null && a2dpProfile.getConnectionState(device) == BluetoothProfile.STATE_DISCONNECTED) {
BluetoothA2dp a2dp = (BluetoothA2dp) a2dpProfile;
a2dp.isA2dpPlaying(device);
Class<? extends BluetoothA2dp> clazz = a2dp.getClass();
Method m2;
try {
m2 = clazz.getMethod("connect", BluetoothDevice.class);
m2.invoke(a2dp, device);
} catch (Exception e) {
e.printStackTrace();
Logg.i(SPPService.TAG, "error:----" + e.getMessage());
}
Logg.i(SPPService.TAG, "a2dp disconnect--》");
}
}