android - Increasing Activity loading time -


i have 2 activities , b. activity start activity b. doing ui initialization, db query , local storage read operation in oncreate of activity b. problem activity b takes long time come visible. because of such operations in oncreate? want @ least ui changes visible first. please guide me

in oncreate perform heavy tasks in different thread/handler/asynctask. example

public void oncreate(bundle b){     super.oncreate(b);     setcontentview(r.layout.yourlayout);     // other gui initialization     handler h = new handler();     h.post(new runnable{         public void run(){             // heave tasks         }     }); } 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -