A2DP连不上,HFP连上了,代码发你关于A2DP的连不上的代码
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
mBluetoothAdapter.getProfileProxy(getBaseContext(), mProfileListener, BluetoothProfile.A2DP); public void onServiceConnected(int profile, BluetoothProfile proxy) {
if (profile == BluetoothProfile.A2DP) {
System.out.println("456");
mBluetoothA2dp = (BluetoothA2dp) proxy;
}
}
System.out.println(mBluetoothA2dp.resumeSink(mDevice));
System.out.println(mBluetoothA2dp.connect(mDevice));
System.out.println(mBluetoothA2dp.isA2dpPlaying(mDevice));
System.out.println(mBluetoothA2dp.getPriority(mDevice));
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
mBluetoothAdapter.getProfileProxy(getBaseContext(), mProfileListener, BluetoothProfile.A2DP); public void onServiceConnected(int profile, BluetoothProfile proxy) {
if (profile == BluetoothProfile.A2DP) {
System.out.println("456");
mBluetoothA2dp = (BluetoothA2dp) proxy;
}
}
System.out.println(mBluetoothA2dp.resumeSink(mDevice));
System.out.println(mBluetoothA2dp.connect(mDevice));
System.out.println(mBluetoothA2dp.isA2dpPlaying(mDevice));
System.out.println(mBluetoothA2dp.getPriority(mDevice));
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货