Code example for Handler

Methods: obtainMessageremoveMessagessendMessage

0
        mAsyncHandler.removeMessages(REQUEST_TEXTURE_N + id);
    } 
 
    public void onRequestGeometry(int id) {
        if (DBG) Log.v(TAG, "onRequestGeometry(" + id + ")");
        mAsyncHandler.removeMessages(REQUEST_GEOMETRY_N + id);
        mAsyncHandler.sendMessage(mAsyncHandler.obtainMessage(REQUEST_GEOMETRY_N + id, id, 0));
    } 
 
    public void onInvalidateGeometry(int id) {
        if (DBG) Log.v(TAG, "onInvalidateGeometry(" + id + ")");
        mAsyncHandler.removeMessages(REQUEST_GEOMETRY_N + id);
    } 
 
    public void onRequestDetailTexture(int id) {
        if (DBG) Log.v(TAG, "onRequestDetailTexture(" + id + ")" );
        mAsyncHandler.removeMessages(REQUEST_DETAIL_TEXTURE_N + id);
        Message message = mAsyncHandler.obtainMessage(REQUEST_DETAIL_TEXTURE_N + id, id, 0);
        mAsyncHandler.sendMessageDelayed(message, HOLDOFF_DELAY);
    } 
Stop searching for code, let great code find you!  Add Codota to your java IDE