【发布时间】:2014-12-08 14:48:02
【问题描述】:
我正在尝试使用用于 phonegap 的 WebIntent 插件在 android 中打开位置设置。我为 phonegap 使用 GPSDetector 插件来检测位置是否处于活动状态,如果它不处于活动状态,我想打开位置设置。激活位置后按返回按钮并转到 index.html。
window.plugins.webintent.startActivity({
action: 'android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS'},
function() {},
function() {alert('Failed to open URL via Android Intent')}
);
在这种情况下,我不知道是哪个动作,我试过这样但没有奏效。 我做了一个活动,并在那里添加了 onCreate 方法:
startActivityForResult(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS), 0);
但是通过这种方式,我不知道如何在用户打开 Location(Gps) 后将其送回 index.html。 请帮忙,非常感谢
【问题讨论】:
标签: android cordova phonegap-plugins webintents