android - Is onLoadFinished() asynchronous (background thread)? -


i looking @ using loader manager populate expandablelistview in drawerlayout. cannot find anywhere in documentation if callback function onloadfinished() running on ui thread or on background thread. on background thread?

if have called init() ui thread, onloaderfinished() called on ui thread. in cases when call background example asynctaskloader thread notified outcome thread init loader.

...but still can following:

@override     public void onloadfinished(loader<string> arg0, string arg1) {         runnable populate = new runnable(){              @override             public void run() {                 //your code             }          };         if (looper.getmainlooper().getthread() == thread.currentthread()) {             //on ui thread             populate.run();         }else{             this.runonuithread(populate); //or use handler run runnable         }      } 

:)


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -