private PluginResult executeEnableWifi(JSONArray inputs, CallbackContext callbackContext) {
Log.w(LOGTAG, "executeEnableWifi");
Context context = cordova.getActivity().getApplicationContext();
WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
boolean toEnable = true;
try {
toEnable = inputs.getBoolean( 0 );
} catch (JSONException e) {
Log.w(LOGTAG, String.format("Got JSON Exception: %s", e.getMessage()));
return new PluginResult(Status.JSON_EXCEPTION);
}
wifiManager.setWifiEnabled( toEnable );
callbackContext.success();
return null;
}
WifiAdmin.java 文件源码
java
阅读 38
收藏 0
点赞 0
评论 0
项目:cordova-plugin-wifi
作者:
评论列表
文章目录