您的位置:首页 > 移动开发 > Android开发

android 关于webview 加载h5网页开启定位

2016-10-10 11:29 357 查看
//webview定位相关设置
settings.setDomStorageEnabled(true);
settings.setGeolocationEnabled(true);
//settings.setGeolocationDatabasePath(getFilesDir().getPath());
progressWebView.setWebChromeClient(new WebChromeClient() {
@Override
public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
callback.invoke(origin, true, true);
super.onGeolocationPermissionsShowPrompt(origin, callback);
}
});

添加以上代码即可解决h5页面不能定位的问题
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  webview h5网页定位