我在此代码中收到错误消息:“Binder调用错误的界面”:
IBluetoothA2dp ibta = a2dp.connect2.Bt_iadl.ibta2;
try {
if (ibta != null && ibta.getConnectionState(device) == 0)
ibta.connect(device);
else
ibta.disconnect(device);
} catch (Exception e) {
Log.e(LOG_TAG, "Error " + e.getMessage());
}
错误来自 ibta.getConnectionState(设备)
这就是我之前做的事情:
public static ServiceConnection mConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
mIsBound = true;
ibta2 = IBluetoothA2dp.Stub.asInterface(service);
sendIntent();
}
@Override
public void onServiceDisconnected(ComponentName name) {
mIsBound = false;
}
};
以下是我使用.aidl设置包的层次结构:
我做错了什么。我读到了这个问题:SO-Question。 但我并不确切地知道我做错了什么。