android - How to Parse Jsoup data in Fragment (WebView) -
here's fragment.there's no error or still blank screen when open fragment. how can solved thread thing ? want parsing html , show in webview.
@override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { rootview = inflater.inflate(r.layout.menu2_layout_duyurular, container, false); downloadthread.start(); wvfun(); return rootview; } thread downloadthread = new thread() { public void run() { try { doc = jsoup.connect(url_duyurular).get(); div = doc.select("#yazilar").get(0); data += div; log.i("words", data); } catch (ioexception e) { e.printstacktrace(); } } }; public void wvfun() { log.i("working fine", "wvfun working."); webview webview = (webview) rootview.findviewbyid(r.id.duyurular_page); webview.getsettings().setjavascriptenabled(true); webview.loaddata(data, "text/html", "utf-8"); }
my logcat . can see there no error in logcat. "working fine" log earlier "words" log.how can solve , how should use threads.
04-25 19:44:14.042 9144-9144/com.bilgiislem.sems.beunapp i/dalvikvm﹕ not find method android.view.viewgroup.onnestedscrollaccepted, referenced method android.support.v7.internal.widget.actionbaroverlaylayout.onnestedscrollaccepted 04-25 19:44:14.042 9144-9144/com.bilgiislem.sems.beunapp w/dalvikvm﹕ vfy: unable resolve virtual method 12606: landroid/view/viewgroup;.onnestedscrollaccepted (landroid/view/view;landroid/view/view;i)v 04-25 19:44:14.042 9144-9144/com.bilgiislem.sems.beunapp i/dalvikvm﹕ not find method android.view.viewgroup.onstopnestedscroll, referenced method android.support.v7.internal.widget.actionbaroverlaylayout.onstopnestedscroll 04-25 19:44:14.042 9144-9144/com.bilgiislem.sems.beunapp w/dalvikvm﹕ vfy: unable resolve virtual method 12612: landroid/view/viewgroup;.onstopnestedscroll (landroid/view/view;)v 04-25 19:44:14.052 9144-9144/com.bilgiislem.sems.beunapp i/dalvikvm﹕ not find method android.support.v7.internal.widget.actionbaroverlaylayout.stopnestedscroll, referenced method android.support.v7.internal.widget.actionbaroverlaylayout.sethideoncontentscrollenabled 04-25 19:44:14.052 9144-9144/com.bilgiislem.sems.beunapp w/dalvikvm﹕ vfy: unable resolve virtual method 10134: landroid/support/v7/internal/widget/actionbaroverlaylayout;.stopnestedscroll ()v 04-25 19:44:14.052 9144-9144/com.bilgiislem.sems.beunapp i/dalvikvm﹕ not find method android.content.res.typedarray.getchangingconfigurations, referenced method android.support.v7.internal.widget.tinttypedarray.getchangingconfigurations 04-25 19:44:14.052 9144-9144/com.bilgiislem.sems.beunapp w/dalvikvm﹕ vfy: unable resolve virtual method 565: landroid/content/res/typedarray;.getchangingconfigurations ()i 04-25 19:44:14.052 9144-9144/com.bilgiislem.sems.beunapp i/dalvikvm﹕ not find method android.content.res.typedarray.gettype, referenced method android.support.v7.internal.widget.tinttypedarray.gettype 04-25 19:44:14.052 9144-9144/com.bilgiislem.sems.beunapp w/dalvikvm﹕ vfy: unable resolve virtual method 587: landroid/content/res/typedarray;.gettype (i)i 04-25 19:44:14.052 9144-9144/com.bilgiislem.sems.beunapp i/dalvikvm﹕ not find method android.content.res.resources.getdrawable, referenced method android.support.v7.internal.widget.resourceswrapper.getdrawable 04-25 19:44:14.052 9144-9144/com.bilgiislem.sems.beunapp w/dalvikvm﹕ vfy: unable resolve virtual method 528: landroid/content/res/resources;.getdrawable (ilandroid/content/res/resources$theme;)landroid/graphics/drawable/drawable; 04-25 19:44:14.052 9144-9144/com.bilgiislem.sems.beunapp i/dalvikvm﹕ not find method android.content.res.resources.getdrawablefordensity, referenced method android.support.v7.internal.widget.resourceswrapper.getdrawablefordensity 04-25 19:44:14.052 9144-9144/com.bilgiislem.sems.beunapp w/dalvikvm﹕ vfy: unable resolve virtual method 530: landroid/content/res/resources;.getdrawablefordensity (iilandroid/content/res/resources$theme;)landroid/graphics/drawable/drawable; 04-25 19:44:14.812 9144-9144/com.bilgiislem.sems.beunapp i/dalvikvm-heap﹕ grow heap (frag case) 11.092mb 6656416-byte allocation 04-25 19:44:14.952 9144-9144/com.bilgiislem.sems.beunapp e/imgsrv﹕ :0: pvrdrmopen: tp3, ret = 50 04-25 19:44:14.962 9144-9144/com.bilgiislem.sems.beunapp e/imgsrv﹕ :0: pvrdrmopen: tp3, ret = 53 04-25 19:44:14.962 9144-9144/com.bilgiislem.sems.beunapp e/imgsrv﹕ :0: pvrdrmopen: tp3, ret = 54 04-25 19:44:14.962 9144-9144/com.bilgiislem.sems.beunapp e/imgsrv﹕ :0: pvrdrmopen: tp3, ret = 54 04-25 19:44:14.962 9144-9144/com.bilgiislem.sems.beunapp e/imgsrv﹕ :0: pvrdrmopen: tp3, ret = 54 04-25 19:44:14.972 9144-9144/com.bilgiislem.sems.beunapp e/imgsrv﹕ :0: pvrdrmopen: tp3, ret = 56 04-25 19:44:18.492 9144-9144/com.bilgiislem.sems.beunapp i/chromium﹕ [info:library_loader_hooks.cc(112)] chromium logging enabled: level = 0, default verbosity = 0 04-25 19:44:18.492 9144-9144/com.bilgiislem.sems.beunapp i/browserprocessmain﹕ initializing chromium process, renderers=0 04-25 19:44:18.512 9144-9196/com.bilgiislem.sems.beunapp w/chromium﹕ [warning:proxy_service.cc(888)] pac support disabled because there no system implementation 04-25 19:44:18.572 9144-9144/com.bilgiislem.sems.beunapp i/working fine﹕ wvfun working. 04-25 19:44:18.592 9144-9144/com.bilgiislem.sems.beunapp w/awcontents﹕ nativeondraw failed; clearing background color. 04-25 19:44:18.852 9144-9144/com.bilgiislem.sems.beunapp i/chromium﹕ [info:async_pixel_transfer_manager_android.cc(56)] async pixel transfers not supported 04-25 19:44:18.882 9144-9144/com.bilgiislem.sems.beunapp i/chromium﹕ [info:async_pixel_transfer_manager_android.cc(56)] async pixel transfers not supported 04-25 19:44:18.882 9144-9144/com.bilgiislem.sems.beunapp e/imgsrv﹕ :0: pvrdrmopen: tp3, ret = 97 04-25 19:44:18.882 9144-9144/com.bilgiislem.sems.beunapp e/imgsrv﹕ :0: pvrdrmopen: tp3, ret = 102 04-25 19:44:18.892 9144-9144/com.bilgiislem.sems.beunapp e/imgsrv﹕ :0: pvrdrmopen: tp3, ret = 103 04-25 19:44:18.892 9144-9144/com.bilgiislem.sems.beunapp e/imgsrv﹕ :0: pvrdrmopen: tp3, ret = 104 04-25 19:44:18.892 9144-9144/com.bilgiislem.sems.beunapp e/imgsrv﹕ :0: pvrdrmopen: tp3, ret = 105 04-25 19:44:18.892 9144-9144/com.bilgiislem.sems.beunapp e/imgsrv﹕ :0: pvrdrmopen: tp3, ret = 106 04-25 19:44:18.892 9144-9144/com.bilgiislem.sems.beunapp e/imgsrv﹕ :0: pvrdrmopen: tp3, ret = 107 04-25 19:44:18.942 9144-9151/com.bilgiislem.sems.beunapp i/dalvikvm﹕ total arena pages jit: 11 04-25 19:44:18.942 9144-9151/com.bilgiislem.sems.beunapp i/dalvikvm﹕ total arena pages jit: 12 04-25 19:44:18.952 9144-9151/com.bilgiislem.sems.beunapp i/dalvikvm﹕ total arena pages jit: 13 04-25 19:44:19.252 9144-9151/com.bilgiislem.sems.beunapp i/dalvikvm﹕ total arena pages jit: 14 04-25 19:44:19.252 9144-9151/com.bilgiislem.sems.beunapp i/dalvikvm﹕ total arena pages jit: 15 04-25 19:44:19.252 9144-9151/com.bilgiislem.sems.beunapp i/dalvikvm﹕ total arena pages jit: 16 04-25 19:44:19.262 9144-9151/com.bilgiislem.sems.beunapp i/dalvikvm﹕ total arena pages jit: 17 04-25 19:44:19.262 9144-9151/com.bilgiislem.sems.beunapp i/dalvikvm﹕ total arena pages jit: 18 04-25 19:44:19.262 9144-9151/com.bilgiislem.sems.beunapp i/dalvikvm﹕ total arena pages jit: 19 04-25 19:44:19.262 9144-9151/com.bilgiislem.sems.beunapp i/dalvikvm﹕ total arena pages jit: 20 04-25 19:44:20.162 9144-9203/com.bilgiislem.sems.beunapp i/yazilar﹕ <td id="yazilar"> <div id="yazi-baslik"> duyurular </div> <ul> <li> <a href="/duyurular/1547/b-ii-arge-ve-inovasyon-proje-pazari-b.html"><b>ii. arge ve İnovasyon proje pazarı</b></a> </li> </ul> <ul> <li> <a href="/duyurular/1600/tomerler-beude-bulusuyor.html">tÖmer'ler beÜ'de buluşuyor</a> </li> </ul> <ul> <li> <a href="/duyurular/1599/vefat.html">vefat</a> </li> </ul> <ul> <li> <a href="/duyurular/1588/ebys-kullanicilarina-duyurulur.html">ebys kullanıcılarına duyurulur</a> </li> </ul> <ul> <li> <a href="/duyurular/1598/bulent-ecevit-universitesi-21-uluslararasi-bilim-ve-genclik-haftasi-sportif-etkinlikler-duyurusu.html">bülent ecevit Üniversitesi 21. uluslararası bilim ve gençlik haftası sportif etkinlikler duyurusu</a> </li> </ul> <ul> <li> <a href="/duyurular/1597/i-karaelmas-evde-saglik-ve-sosyal-hizmetler-sempozyumu.html">i. karaelmas evde sağlık ve sosyal hizmetler sempozyumu</a> </li> </ul> <ul> <li> <a href="/duyurular/1596/2015-ales-bahar-donemi-gorev-talep-islemleri.html">2015-ales bahar dönemi görev talep İşlemleri</a> </li> </ul> <ul> <li> <a href="/duyurular/1595/aday-memur-temel-egitim-sinav-sonuclari.html">aday memur temel eğitim sınav sonuçları</a> </li> </ul> <ul> <li> <a href="/duyurular/1594/radyo-karaelmasta-engelsiz-universiteye-dogru-basliyor.html">radyo karaelmas'ta ""engelsiz Üniversiteye doğru" başlıyor!</a> </li> </ul> <ul> <li> <a href="/duyurular/1592/1-set-spectbt-spect-gama-kamerabilgisayarli-tomografi-hibrid-goruntuleme-sistemi-alimi.html">1 set spectbt (spect gama kamerabilgisayarlı tomografi hibrid görüntüleme) sistemi alımı</a> </li> </ul> <ul> <li> <a href="/duyurular/1591/2015-2016-akademik-yili-erasmus-ogrenci-ogrenim-ve-staj-hareketliligi-yerlestirme-sonuclari.html">2015-2016 akademik yılı erasmus+ Öğrenci Öğrenim ve staj hareketliliği yerleştirme sonuçları</a> </li> </ul> </td>
now can parse , show on webview .
@override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.menu2_layout_duyurular, container, false); final webview webview = (webview) rootview.findviewbyid(r.id.duyurular_page); webview.getsettings().setjavascriptenabled(true); // webview.addjavascriptinterface(new myjavascriptinterface(this), "htmlviewer"); downloadthread.start(); webview.setwebviewclient(new webviewclient() { @override public void onpagefinished(webview view, string url) { webview.loaddata(data, "text/html", null); } }); webview.loadurl(url_duyurular); return rootview; } thread downloadthread = new thread() { public void run() { try { doc = jsoup.connect(url_duyurular).get(); div = doc.select("#yazilar").get(0); data += div; log.i("words", data); } catch (ioexception e) { e.printstacktrace(); } }
Comments
Post a Comment