标签:打开 roi pre 获取 time run spro star ==
if (plus.os.name == "Android") { var context = plus.android.importClass("android.content.Context"); var locationManager = plus.android.importClass("android.location.LocationManager"); var main = plus.android.runtimeMainActivity(); var mainSvr = main.getSystemService(context.LOCATION_SERVICE); var gpsProvider = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER); //检查是否开启了GPS if (!gpsProvider) { var message = "为了获取您的精准位置,请开启GPS设备。"; var title = "GPS未启用"; var alertCB = function() { var Intent = plus.android.importClass("android.content.Intent"); var mIntent = new Intent(‘android.settings.LOCATION_SOURCE_SETTINGS‘); main.startActivity(mIntent); //打开GPS设置 } plus.nativeUI.alert(message, alertCB, title); } }
标签:打开 roi pre 获取 time run spro star ==
原文地址:https://www.cnblogs.com/fanqiuzhuji/p/12658670.html