主题 : device.getClass().getMethod("getServiceChannel") 會有問題 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 37502
精华: 0
发帖: 48
金钱: 240 两
威望: 48 点
贡献值: 0 点
综合积分: 96 分
注册时间: 2011-02-11
最后登录: 2011-09-06
楼主  发表于: 2011-05-03 19:22

 device.getClass().getMethod("getServiceChannel") 會有問題

Greeting ,
  最近在調用 Bluetooth Hide API 時,有些 API 會出現 NoSuchMethodException  的錯誤

例如:
m_getServiceChannel = blueToothDevice.getClass().getMethod("getServiceChannel");

我想要調用隱藏的 getServiceChannel 但是會出現 NoSuchMethodException 的錯誤,

相同的方法,我調用 createRfcommSocket 則是正常,例如:

Method m = blueToothDevice.getClass().getMethod("createRfcommSocket", new Class[] { int.class });
sock = (BluetoothSocket)m.invoke(blueToothDevice, Integer.valueOf(1));

請問是不是我調用 getServiceChannel 的方式不對呢?