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页面不能定位的问题
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页面不能定位的问题
相关文章推荐
- android 关于webview 加载h5网页开启定位的方法
- android h5 js 混合开发解决webview加载白屏,不加载网页的问题(硬件加速网页渲染,优化体验)
- 关于Android之WebView加载网页缓存和清除问题
- android webview 加载网页显示对话框
- android 中webView 加载网页时隐藏浏览器地址栏
- Android中的WebView进行直接加载网页
- Android中的WebView进行直接加载网页
- android WebView, WebChromeClient和WebViewClient加载网页基本用法
- Android中使用WebView, WebChromeClient和WebViewClient加载网页
- Android中使用WebView, WebChromeClient和WebViewClient加载网页
- Android_WebView加载网页保存信息到Cookie
- Android中使用WebView, WebChromeClient和WebViewClient加载网页
- android WebView, WebChromeClient跟WebViewClient加载网页基本用法
- [Android]webview直接加载网页<允许JS,进度条,当前应用内跳转>
- Android--当webview加载网页的时候在标题栏上显示加载进度
- android WebView, WebChromeClient和WebViewClient加载网页基本用法
- android WebView加载网页视频
- Android 编程下 WebView 加载一个网页如何得到网页的 Cookie 值
- Android使用原生组件WebView加载网页和数据的方法
- android程序中关于webview加载html文件