Example usage for android.os Handler removeMessages

List of usage examples for android.os Handler removeMessages

Introduction

In this page you can find the example usage for android.os Handler removeMessages.

Prototype

public final void removeMessages(int what, Object object) 

Source Link

Document

Remove any pending posts of messages with code 'what' and whose obj is 'object' that are in the message queue.

Usage

From source file:mp.teardrop.LibraryPagerAdapter.java

/**
 * Schedule a query to be run for the given adapter on the worker thread.
 *
 * @param adapter The adapter to run the query for.
 */// ww  w. java  2 s  .  c  o  m
private void postRunQuery(LibraryAdapter adapter) {
    mRequeryNeeded[adapter != null ? adapter.getMediaType() : MediaUtils.TYPE_UNIFIED] = false;
    Handler handler = mWorkerHandler;
    handler.removeMessages(MSG_RUN_QUERY, adapter);
    handler.sendMessage(handler.obtainMessage(MSG_RUN_QUERY, adapter));
}

From source file:ch.blinkenlights.android.vanilla.LibraryPagerAdapter.java

/**
 * Schedule a query to be run for the given adapter on the worker thread.
 *
 * @param adapter The adapter to run the query for.
 *///from  www  . ja  va2  s  .  c  o m
private void postRunQuery(LibraryAdapter adapter) {
    mRequeryNeeded[adapter.getMediaType()] = false;
    Handler handler = mWorkerHandler;
    handler.removeMessages(MSG_RUN_QUERY, adapter);
    handler.sendMessage(handler.obtainMessage(MSG_RUN_QUERY, adapter));
}