Back to project page sres.
The source code is released under:
Apache License
If you think the Android project sres listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package me.tatarka.sres; //from w ww .j ava 2s. c o m import android.os.Handler; import android.os.Looper; /** * Created by evan on 3/22/14. */ public class ThreadHandlerImpl implements ThreadHandler { private Handler handler; @Override public boolean isOnMainThread() { return Thread.currentThread() == Looper.getMainLooper().getThread(); } @Override public void postToMainThread(Runnable runnable) { if (handler == null) handler = new Handler(Looper.getMainLooper()); handler.post(runnable); } }