Handler sendMessageDelayed - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Handler sendMessageDelayed method.

This code example shows how to use the following methods: obtainMessage, removeMessages, sendMessage, sendMessageDelayed
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: obtainMessage, removeMessages, sendMessageDelayed
    /** 
     * Start up the pulse to fade the screen, clearing any existing pulse to 
     * ensure that we don't have multiple pulses running at a time. 
     */ 
    void startFading() { 
        mHandler.removeMessages(MSG_FADE);
        scheduleFade(); 
    } 
 
    /** 
     * Stop the pulse to fade the screen. 
     */ 
    void stopFading() { 
        mHandler.removeMessages(MSG_FADE);
    } 
 
    /** 
     * Schedule a fade message for later. 
     */ 
    void scheduleFade() { 

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: obtainMessage, sendMessageDelayed
    } 
 
    public void onStart() { 
        super.onStart(); 
        setEnabled(false); 
        mHandler.sendMessageDelayed(mHandler.obtainMessage(0), 1000);
    } 
 
    public boolean dispatchKeyEvent(KeyEvent event) {
        if (mConsuming) {
            //Slog.i(TAG, "Consuming: " + event); 
            return true; 
        } 
        //Slog.i(TAG, "Dispatching: " + event); 
        return super.dispatchKeyEvent(event);
    } 
 
    private void setEnabled(boolean enabled) {
        Button b = (Button)findViewById(R.id.button1);
        if (b != null) {
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: obtainMessage, sendMessageDelayed
    this.autoFocusMessage = autoFocusMessage;
  } 
 
  public void onAutoFocus(boolean success, Camera camera) {
    if (autoFocusHandler != null) {
      Message message = autoFocusHandler.obtainMessage(autoFocusMessage, success);
      // Simulate continuous autofocus by sending a focus request every 
      // AUTOFOCUS_INTERVAL_MS milliseconds. 
      //Log.d(TAG, "Got auto-focus callback; requesting another"); 
      autoFocusHandler.sendMessageDelayed(message, AUTOFOCUS_INTERVAL_MS);
      autoFocusHandler = null;
    } else { 
      Log.d(TAG, "Got auto-focus callback, but no handler for it");
    } 
  } 
 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: obtainMessage, sendMessageDelayed
        Log.v(LOGTAG, "Navigating to URL: " + url);
        webView.loadUrl(url);
 
        if(timeout != 0) {
            //set a timer with specified timeout (in ms) 
            handler.sendMessageDelayed(handler.obtainMessage(MSG_TIMEOUT),
                    timeout);
        } 
    } 
 
    @Override 
    protected void onDestroy() { 
        super.onDestroy(); 
        Log.v(LOGTAG, "onDestroy, inst=" + Integer.toHexString(hashCode()));
        webView.clearCache(true);
        webView.destroy();
    } 
 
    private boolean isPageDone() { 
        synchronized (pageDoneLock) {
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Handler sendMessageDelayed Questions & Answers:

sendMessageDelayed Method Overview
Enqueue a message into the message queue after all pending messages before (current time + delayMillis).
See Code Examples for other Android Handler Methods: