@Override public void execute(Runnable r) { handler.post(r); } }
@Override public void exit () { handler.post(new Runnable() { @Override public void run () { callbacks.exit(); } }); }
@Override public void exit () { handler.post(new Runnable() { @Override public void run () { callbacks.exit(); } }); }
@Override public void exit () { handler.post(new Runnable() { @Override public void run () { AndroidApplication.this.finish(); } }); }
@Override public void exit () { handler.post(new Runnable() { @Override public void run () { AndroidDaydream.this.finish(); } }); }
@Override public void exit () { handler.post(new Runnable() { @Override public void run () { AndroidApplication.this.finish(); } }); }
@Override public void exit () { handler.post(new Runnable() { @Override public void run () { AndroidDaydream.this.finish(); } }); }
private void postWaitForIdle(final Retryable retryable, final int failedAttempts) { mainHandler.post(new Runnable() { @Override public void run() { waitForIdle(retryable, failedAttempts); } }); }
private void cancelToast(final Toast toast) { if (toast == null) { return; } mainHandler.post(new Runnable() { @Override public void run() { toast.cancel(); } }); } }
@Override public void setOnscreenKeyboardVisible (final boolean visible) { handle.post(new Runnable() { public void run () { InputMethodManager manager = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE); if (visible) { View view = ((AndroidGraphics)app.getGraphics()).getView(); view.setFocusable(true); view.setFocusableInTouchMode(true); manager.showSoftInput(((AndroidGraphics)app.getGraphics()).getView(), 0); } else { manager.hideSoftInputFromWindow(((AndroidGraphics)app.getGraphics()).getView().getWindowToken(), 0); } } }); }
@Override public void setOnscreenKeyboardVisible (final boolean visible) { handle.post(new Runnable() { public void run () { InputMethodManager manager = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE); if (visible) { View view = ((AndroidGraphics)app.getGraphics()).getView(); view.setFocusable(true); view.setFocusableInTouchMode(true); manager.showSoftInput(((AndroidGraphics)app.getGraphics()).getView(), 0); } else { manager.hideSoftInputFromWindow(((AndroidGraphics)app.getGraphics()).getView().getWindowToken(), 0); } } }); }
@Override public void execute(@NonNull Runnable command) { handler.post(command); } };
@Override public void runOnUiThread (Runnable runnable) { if (Looper.myLooper() != Looper.getMainLooper()) { // The current thread is not the UI thread. // Let's post the runnable to the event queue of the UI thread. new Handler(Looper.getMainLooper()).post(runnable); } else { // The current thread is the UI thread already. // Let's execute the runnable immediately. runnable.run(); } }
@Override public void runOnUiThread (Runnable runnable) { if (Looper.myLooper() != Looper.getMainLooper()) { // The current thread is not the UI thread. // Let's post the runnable to the event queue of the UI thread. new Handler(Looper.getMainLooper()).post(runnable); } else { // The current thread is the UI thread already. // Let's execute the runnable immediately. runnable.run(); } }
@Override public void runOnUiThread (Runnable runnable) { if (Looper.myLooper() != Looper.getMainLooper()) { // The current thread is not the UI thread. // Let's post the runnable to the event queue of the UI thread. new Handler(Looper.getMainLooper()).post(runnable); } else { // The current thread is the UI thread already. // Let's execute the runnable immediately. runnable.run(); } }
@Override public void runOnUiThread (Runnable runnable) { if (Looper.myLooper() != Looper.getMainLooper()) { // The current thread is not the UI thread. // Let's post the runnable to the event queue of the UI thread. new Handler(Looper.getMainLooper()).post(runnable); } else { // The current thread is the UI thread already. // Let's execute the runnable immediately. runnable.run(); } }
@Override public void onSystemUiVisibilityChange (int arg0) { application.getHandler().post(new Runnable() { @Override public void run () { application.useImmersiveMode(true); } }); } });
@Override public void onSystemUiVisibilityChange (int arg0) { application.getHandler().post(new Runnable() { @Override public void run () { application.useImmersiveMode(true); } }); } });
static void runTask(Runnable r, boolean sync, Handler handler, ImageLoaderEngine engine) { if (sync) { r.run(); } else if (handler == null) { engine.fireCallback(r); } else { handler.post(r); } }
protected void waitForHandler(Handler handler) { final CountDownLatch doneLatch = new CountDownLatch(1); handler.post(new Runnable() { @Override public void run() { doneLatch.countDown(); } }); awaitLatch(doneLatch, 10); }