
我想知道在触发switchTolocationSettings()函数后是否可以进行回调.
我想知道用户是否在他的设备上启用了GPS.
我这样使用它:
cordova.plugins.diagnostic.switchTolocationSettings();
但我想要这样的事情:
cordova.plugins.diagnostic.switchTolocationSettings(Success,Error);
可能吗?
解决方法 根据Java代码,此函数没有回调方法.检查下方 –/** * Requests that the user enable the location in device settings. */public voID switchTolocationSettings() { Log.d(LOG_TAG,"Switch to Location Settings"); Intent settingsIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); ctx.startActivity(settingsIntent);} 这就是为什么你不能在这个方法中传递任何额外的回调函数.你必须编写自己的代码.
总结以上是内存溢出为你收集整理的android – Cordova诊断插件switchToLocationSettings()全部内容,希望文章能够帮你解决android – Cordova诊断插件switchToLocationSettings()所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)