Android WebView页面中点击H5页面没有响应问题。
2017-05-19 13:58
741 查看
Android WebView页面中点击H5页面没有响应问题。
之前还一直以为是WebSettings设置不正确导致的,后面查了一下setWebChromeClient方法必须放在setWebViewClient的前面。
之前还一直以为是WebSettings设置不正确导致的,后面查了一下setWebChromeClient方法必须放在setWebViewClient的前面。
// Let's display the progress in the activity title bar, like the // browser app does. getWindow().requestFeature(Window.FEATURE_PROGRESS); webview.getSettings().setJavaScriptEnabled(true); final Activity activity = this; webview.setWebChromeClient(new WebChromeClient() { public void onProgressChanged(WebView view, int progress) { // Activities and WebViews measure progress with different scales. // The progress meter will automatically disappear when we reach 100% activity.setProgress(progress * 1000); } }); webview.setWebViewClient(new WebViewClient() { public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show(); } }); webview.loadUrl("http://developer.android.com/");
相关文章推荐
- android用webview加载H5页面出现点击事件失效的问题解决
- Android中WebView加载H5页面JS不执行的问题
- android:WebView在没有网络情况下,点击当前页面内链接不跳转并弹出提示框
- Android Webview中解决H5的音视频不能自动播放、只有声音没有图像的问题
- android webview 点击页面输入框导致页面变大问题的解决
- android webview 加载重定向页面时点击无法回退,导致重复加载当前页面问题的解决方案
- android 加载web view的时候,点击输入框,导致页面放大的问题解决方法
- Android使用Webview显示页面以及点击跳转startActivity问题
- Android 安卓WebView套壳H5网页 手机返回键问题(过滤二级页面,返回键相应给WebView)
- android webview中加入无线淘宝客页面点击宝贝详情链接进入宝贝详情页面后无法返回问题
- android原生WebView打开h5页面加载显示不完整错乱问题
- Android原生webView加载h5页面出现加载错乱不完全问题
- Android 真机,微信打开 H5,切换到 webview,能通过 webdriver 方法操作页面元素,然后链接到新的 H5 页面后,无法操作元素,appium 服务器没有收到 response,
- Android使用WebView嵌入网页,网页内点击跳转到另一个网页后,返回问题解决
- Android 响应webview中图片的点击事件
- android webview js交互, 响应webview中的图片点击事件
- Android菜鸟学习笔记(WebView加载html页面,页面提交数据问题)
- 响应webview中的图片点击事件 (android webview js交互)
- android webview js交互, 响应webview中的图片点击事件
- android webview js交互, 响应webview中的图片点击事件