qq_27751729
qq_27751729
采纳率0%
2016-01-18 08:31 阅读 1.4k

java隐藏函数调用失败---求教

private void removeAndDeleteGroup(WifiP2pGroup wifiP2pGroup) {
mManager.removeGroup(mChannel, null);
try {
Method getNetworkId = WifiP2pGroup.class.getDeclaredMethod("getNetworkId");
Integer networkId = (Integer) getNetworkId.invoke(wifiP2pGroup);
Method deletePersistentGroup = WifiP2pManager.class.getDeclaredMethod("deletePersistentGroup",
WifiP2pManager.Channel.class, Integer.class, WifiP2pManager.ActionListener.class);
deletePersistentGroup.invoke(mManager, mChannel, networkId, null);
} catch (NoSuchMethodException e) {
Log.e("WIFI", "Could not delete persistent group", e);
} catch (InvocationTargetException e) {
Log.e("WIFI", "Could not delete persistent group", e);
} catch (IllegalAccessException e) {
Log.e("WIFI", "Could not delete persistent group", e);
}
}
显示NoSuchMethodException

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

4条回答 默认 最新

相关推荐