public void runInUiThread(Runnable r) { if (Thread.currentThread() == Looper.getMainLooper().getThread()) { r.run(); } else { Handler handler = new Handler(Looper.getMainLooper()); handler.post(r); } }
public void runInUiThread(Runnable r) { if (Thread.currentThread() == Looper.getMainLooper().getThread()) { r.run(); } else { Handler handler = new Handler(Looper.getMainLooper()); handler.post(r); } }