android - Loading image url into webview -
i'm trying load image webview http://loremflickr.com/ , doesn't seem work on android 4.3 . can explain me why , how can fix ? work fine android 4.4 , android 5 not 4.3
here's code:
@override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); loadurlinwebview("http://loremflickr.com/320/240/dog"); } private void loadurlinwebview(string _url) { webview mwebview = (webview) findviewbyid(r.id.webviewer); mwebview.setbackgroundcolor(color.transparent); mwebview.setverticalscrollbarenabled(false); mwebview.sethorizontalscrollbarenabled(false); websettings websettings = mwebview.getsettings(); websettings.setjavascriptenabled(true); mwebview.setwebchromeclient(new webchromeclient()); mwebview.setwebviewclient(new mywebviewclient()); mwebview.loadurl(_url); } private class mywebviewclient extends webviewclient { @override public void onreceivederror(webview view, int errorcode, string description, string failingurl) { log.e("tag", "error code " + errorcode); } }
logcat
///logcat 09-30 14:32:33.387 4309-4309/com.myapplication d/dalvikvm﹕ late-enabling checkjni 09-30 14:32:35.395 4309-4309/com.myapplication d/libegl﹕ loaded /vendor/lib/egl/libegl_powervr_sgx540_120.so 09-30 14:32:35.582 4309-4309/com.myapplication d/libegl﹕ loaded /vendor/lib/egl/libglesv1_cm_powervr_sgx540_120.so 09-30 14:32:35.621 4309-4309/com.myapplication d/libegl﹕ loaded /vendor/lib/egl/libglesv2_powervr_sgx540_120.so 09-30 14:32:36.035 4309-4309/com.myapplication d/openglrenderer﹕ enabling debug mode 0 09-30 14:32:36.199 4309-4309/com.myapplication d/tag﹕ onloadresource http://loremflickr.com/320/240/dog 09-30 14:32:37.246 4309-4309/com.myapplication d/tilesmanager﹕ starting tg #0, 0x59fe9ae8 09-30 14:32:37.246 4309-4309/com.myapplication d/tilesmanager﹕ new eglcontext framework: 59ebc0c0 09-30 14:32:37.246 4309-4309/com.myapplication d/glwebviewstate﹕ reinit shader 09-30 14:32:37.262 4309-4309/com.myapplication d/glwebviewstate﹕ reinit transferqueue 09-30 14:32:37.317 4309-4398/com.myapplication w/picturepilelayercontent﹕ warning: painting picturepile without content! 09-30 14:32:37.324 4309-4398/com.myapplication w/picturepilelayercontent﹕ warning: painting picturepile without content! 09-30 14:32:37.324 4309-4398/com.myapplication w/picturepilelayercontent﹕ warning: painting picturepile without content!
you can try this:
webview mwebview = (webview) findviewbyid(r.id.webviewer); mwebview.loadurl("http://loremflickr.com/320/240/dog");
just load image this, work.
Comments
Post a Comment