本地代码
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setBackgroundColor(Color.argb(0, 0, 0, 0));
mWebView.getSettings().setDefaultTextEncodingName("utf-8");
mWebView.addJavascriptInterface(new JsInteration() , "jsObj");
mWebView.loadUrl("http://api.meeyou.net/h5/#/about-us");
mWebView.setWebViewClient(new WebViewClient());
public class JsInteration {
@JavascriptInterface
public void toUser() {
finish();
}
}这是logcat:
04-15 03:19:45.354 29639-29639/com.cttz.obsc I/chromium: [INFO:synchronous_compositor_impl.cc(111)] [SynchronousCompositorImpl::SetClient] [0x0000007f7357ce20]
04-15 03:19:45.357 29639-29639/com.cttz.obsc W/chromium: [WARNING:password_handler.cc(33)] create-->contents = 0x0000007f4fabf800, delegate = 0x0000007f62398420
04-15 03:19:45.357 29639-29639/com.cttz.obsc W/chromium: [WARNING:password_handler.cc(41)] attaching to web_contents
04-15 03:19:45.357 29639-29639/com.cttz.obsc W/AwContents: onDetachedFromWindow called when already detached. Ignoring
04-15 03:19:45.374 29639-29876/com.cttz.obsc I/chromium: [INFO:SkFontConfigParser_android.cpp(301)] [SkFontConfigParser] /system/etc/fonts.xml:104:4: warning: 'DINPro' alias target not found
04-15 03:19:45.375 29639-29876/com.cttz.obsc I/chromium: [INFO:SkFontConfigParser_android.cpp(301)] [SkFontConfigParser] /system/etc/fonts.xml:105:4: warning: 'DINPro' alias target not found
04-15 03:19:45.375 29639-29876/com.cttz.obsc I/chromium: [INFO:SkFontConfigParser_android.cpp(301)] [SkFontConfigParser] /system/etc/fonts.xml:106:4: warning: 'DINPro' alias target not found
04-15 03:19:45.378 29639-29647/com.cttz.obsc I/System: FinalizerDaemon: finalize objects = 449
04-15 03:19:45.391 29639-29666/com.cttz.obsc W/libEGL: [ANDROID_RECORDABLE] format: 1
04-15 03:19:45.402 29639-29639/com.cttz.obsc W/chromium: [WARNING:aw_contents.cc(315)] SP>>> Destroy
04-15 03:19:45.402 29639-29639/com.cttz.obsc I/chromium: [INFO:synchronous_compositor_impl.cc(111)] [SynchronousCompositorImpl::SetClient] [0x0000007f7357c940]
04-15 03:19:45.408 29639-29868/com.cttz.obsc I/chromium: [INFO:mime_util.cc(161)] calling IsSupportedNonImageMimeType
04-15 03:19:45.416 29639-29876/com.cttz.obsc I/chromium: [INFO:SkFontConfigParser_android.cpp(301)] [SkFontConfigParser] /system/etc/fonts.xml:104:4: warning: 'DINPro' alias target not found
04-15 03:19:45.416 29639-29876/com.cttz.obsc I/chromium: [INFO:SkFontConfigParser_android.cpp(301)] [SkFontConfigParser] /system/etc/fonts.xml:105:4: warning: 'DINPro' alias target not found
04-15 03:19:45.416 29639-29876/com.cttz.obsc I/chromium: [INFO:SkFontConfigParser_android.cpp(301)] [SkFontConfigParser] /system/etc/fonts.xml:106:4: warning: 'DINPro' alias target not found
04-15 03:19:45.416 29639-29666/com.cttz.obsc I/[MALI][Gralloc]: [+]r_hnd(0x7f62b3a6c0), client(39), share_fd(115)
04-15 03:19:45.425 29639-29666/com.cttz.obsc I/[MALI][Gralloc]: [+]r_hnd(0x7f59a423c0), client(39), share_fd(114)
04-15 03:19:45.428 29639-29639/com.cttz.obsc I/chromium: [INFO:synchronous_compositor_impl.cc(453)] [RegisterProgressCheckCallback] chromium.skipbeginmainframe=[] enable=[0]
04-15 03:19:45.444 29639-29876/com.cttz.obsc I/chromium: [INFO:mime_util.cc(161)] calling IsSupportedNonImageMimeType
04-15 03:19:45.446 29639-29666/com.cttz.obsc I/[MALI][Gralloc]: [+]r_hnd(0x7f62b399a0), client(39), share_fd(127)
04-15 03:19:45.447 29639-29639/com.cttz.obsc W/BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 29639
04-15 03:19:45.457 29639-29666/com.cttz.obsc I/[MALI][Gralloc]: [-]r_hnd(0x7f517c6240), client(39), share_fd(121)
04-15 03:19:45.458 29639-29666/com.cttz.obsc E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f517c61a0
04-15 03:19:45.458 29639-29666/com.cttz.obsc I/[MALI][Gralloc]: [-]r_hnd(0x7f517c61a0), client(39), share_fd(124)
04-15 03:19:46.565 29639-29639/com.cttz.obsc I/chromium: [INFO:CONSOLE(13922)] "This browser does not support Web Storage!", source: http://api.meeyou.net/h5/libs/angular/angular/angular.js (13922)
04-15 03:19:47.114 29639-29639/com.cttz.obsc W/BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 29639
04-15 03:19:47.155 29639-29639/com.cttz.obsc W/chromium: [WARNING:password_handler.cc(205)] OnPasswordFormsRendered called
04-15 03:19:47.155 29639-29639/com.cttz.obsc W/chromium: [WARNING:password_handler.cc(207)] OnPasswordFormsRendered IsEnabledSavePassword is false
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setBackgroundColor(Color.argb(0, 0, 0, 0));
mWebView.getSettings().setDefaultTextEncodingName("utf-8");
mWebView.addJavascriptInterface(new JsInteration() , "jsObj");
mWebView.loadUrl("http://api.meeyou.net/h5/#/about-us");
mWebView.setWebViewClient(new WebViewClient());
public class JsInteration {
@JavascriptInterface
public void toUser() {
finish();
}
}这是logcat:
04-15 03:19:45.354 29639-29639/com.cttz.obsc I/chromium: [INFO:synchronous_compositor_impl.cc(111)] [SynchronousCompositorImpl::SetClient] [0x0000007f7357ce20]
04-15 03:19:45.357 29639-29639/com.cttz.obsc W/chromium: [WARNING:password_handler.cc(33)] create-->contents = 0x0000007f4fabf800, delegate = 0x0000007f62398420
04-15 03:19:45.357 29639-29639/com.cttz.obsc W/chromium: [WARNING:password_handler.cc(41)] attaching to web_contents
04-15 03:19:45.357 29639-29639/com.cttz.obsc W/AwContents: onDetachedFromWindow called when already detached. Ignoring
04-15 03:19:45.374 29639-29876/com.cttz.obsc I/chromium: [INFO:SkFontConfigParser_android.cpp(301)] [SkFontConfigParser] /system/etc/fonts.xml:104:4: warning: 'DINPro' alias target not found
04-15 03:19:45.375 29639-29876/com.cttz.obsc I/chromium: [INFO:SkFontConfigParser_android.cpp(301)] [SkFontConfigParser] /system/etc/fonts.xml:105:4: warning: 'DINPro' alias target not found
04-15 03:19:45.375 29639-29876/com.cttz.obsc I/chromium: [INFO:SkFontConfigParser_android.cpp(301)] [SkFontConfigParser] /system/etc/fonts.xml:106:4: warning: 'DINPro' alias target not found
04-15 03:19:45.378 29639-29647/com.cttz.obsc I/System: FinalizerDaemon: finalize objects = 449
04-15 03:19:45.391 29639-29666/com.cttz.obsc W/libEGL: [ANDROID_RECORDABLE] format: 1
04-15 03:19:45.402 29639-29639/com.cttz.obsc W/chromium: [WARNING:aw_contents.cc(315)] SP>>> Destroy
04-15 03:19:45.402 29639-29639/com.cttz.obsc I/chromium: [INFO:synchronous_compositor_impl.cc(111)] [SynchronousCompositorImpl::SetClient] [0x0000007f7357c940]
04-15 03:19:45.408 29639-29868/com.cttz.obsc I/chromium: [INFO:mime_util.cc(161)] calling IsSupportedNonImageMimeType
04-15 03:19:45.416 29639-29876/com.cttz.obsc I/chromium: [INFO:SkFontConfigParser_android.cpp(301)] [SkFontConfigParser] /system/etc/fonts.xml:104:4: warning: 'DINPro' alias target not found
04-15 03:19:45.416 29639-29876/com.cttz.obsc I/chromium: [INFO:SkFontConfigParser_android.cpp(301)] [SkFontConfigParser] /system/etc/fonts.xml:105:4: warning: 'DINPro' alias target not found
04-15 03:19:45.416 29639-29876/com.cttz.obsc I/chromium: [INFO:SkFontConfigParser_android.cpp(301)] [SkFontConfigParser] /system/etc/fonts.xml:106:4: warning: 'DINPro' alias target not found
04-15 03:19:45.416 29639-29666/com.cttz.obsc I/[MALI][Gralloc]: [+]r_hnd(0x7f62b3a6c0), client(39), share_fd(115)
04-15 03:19:45.425 29639-29666/com.cttz.obsc I/[MALI][Gralloc]: [+]r_hnd(0x7f59a423c0), client(39), share_fd(114)
04-15 03:19:45.428 29639-29639/com.cttz.obsc I/chromium: [INFO:synchronous_compositor_impl.cc(453)] [RegisterProgressCheckCallback] chromium.skipbeginmainframe=[] enable=[0]
04-15 03:19:45.444 29639-29876/com.cttz.obsc I/chromium: [INFO:mime_util.cc(161)] calling IsSupportedNonImageMimeType
04-15 03:19:45.446 29639-29666/com.cttz.obsc I/[MALI][Gralloc]: [+]r_hnd(0x7f62b399a0), client(39), share_fd(127)
04-15 03:19:45.447 29639-29639/com.cttz.obsc W/BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 29639
04-15 03:19:45.457 29639-29666/com.cttz.obsc I/[MALI][Gralloc]: [-]r_hnd(0x7f517c6240), client(39), share_fd(121)
04-15 03:19:45.458 29639-29666/com.cttz.obsc E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f517c61a0
04-15 03:19:45.458 29639-29666/com.cttz.obsc I/[MALI][Gralloc]: [-]r_hnd(0x7f517c61a0), client(39), share_fd(124)
04-15 03:19:46.565 29639-29639/com.cttz.obsc I/chromium: [INFO:CONSOLE(13922)] "This browser does not support Web Storage!", source: http://api.meeyou.net/h5/libs/angular/angular/angular.js (13922)
04-15 03:19:47.114 29639-29639/com.cttz.obsc W/BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 29639
04-15 03:19:47.155 29639-29639/com.cttz.obsc W/chromium: [WARNING:password_handler.cc(205)] OnPasswordFormsRendered called
04-15 03:19:47.155 29639-29639/com.cttz.obsc W/chromium: [WARNING:password_handler.cc(207)] OnPasswordFormsRendered IsEnabledSavePassword is false
解决方案 »
- android中SimpleAdapter的问题
- 如何刷新activity上的一个textView
- Service 使用Notification 找不到布局的view
- 2011华为“智汇云”开发者沙龙深圳站火热招募中
- CardLayout是不是java特有的?
- sign-in/sync error
- .MediaRecorder.getMaxAmplitude() 得到的值一直是0
- 微信好友相册 批量下载 提供思路
- android如何取得压缩图片后的数据
- 独立开发:android版私服传奇[源码仅供学习参考]
- 安卓双摄手机的摄像头数据获取
- 如何使用MediaRecorder本地录制的同时往服务器上传数据流?
啊,很明显,这是什么鬼协议,不是http也不是https,chromium当然不认识了。
呐,解决办法就是把自己APP中webview不支持的url过滤掉就行了。public boolean shouldOverrideUrlLoading(WebView view, String url) 这个方法中如果不支持当前的url则返回true,true表示拦截url之后自己处理,自己不去加载它即可。