text loading delay in android activity -
given below (oncreate) code use display information on screen of android app. activity getting loaded on event triggered in activity. problem when screen loaded. first loads blank screen , renders relevant text on delay. delay can noticed end user , makes them feel screen getting loaded twice. there solution this?
@override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_end); commonutils.changeactionbarcolor(getsupportactionbar()); //get respective child object has displayed in gui string childobjectkey = getintent().getstringextra(child_object_key); // single method pop(), both pushweak() , pushstrong() endobject = (ipend) asfobjectstore.getdefault().pop(childobjectkey); this.settitle(endobject.getpathwayname()); //endwebview webview endwebview=(webview)findviewbyid(r.id.endwebview); string tempendstring = htmlconverter.changefontsize(endobject.getendtext(), utilconstants.global_font_size); tempendstring = htmlconverter.changefontfamily(tempendstring,utilconstants.global_font_family); endwebview.loaddata(tempendstring,"text/html;charset=utf-8","utf-8"); //overall image button imagebutton overviewbutton = (imagebutton) findviewbyid(r.id.endoverviewimagebutton); overviewbutton.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { //showoverviewimage("bleeding (first trimester).jpg"); layoutinflater layoutinflater = (layoutinflater) getsystemservice(context.layout_inflater_service); view view = layoutinflater.inflate(r.layout.image_popup, (viewgroup) findviewbyid(r.id.popup_element)); button btnclosepopup = (button) view.findviewbyid(r.id.cancel_button); string imagefilename = endobject.getpathwayname()+ utilconstants.image_file_extension; commonutils utils = new commonutils(); utils.showoverviewimage(imagefilename, getwindowmanager(), getapplicationcontext(), layoutinflater, view,end.this); } }); }
Comments
Post a Comment