Handler sendEmptyMessage - 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 sendEmptyMessage method.

This code example shows how to use the following methods:sendEmptyMessage
	public void hide(KrollDict options)
	{ 
		if (!visible) {
			return; 
		} 
		handler.sendEmptyMessage(MSG_HIDE);
	} 
 
	protected void handleHide() { 
		if (progressDialog != null) {
			Activity ownerActivity = progressDialog.getOwnerActivity();
			if (ownerActivity != null && !ownerActivity.isFinishing()) {
				((TiBaseActivity)ownerActivity).removeDialog(progressDialog);
				progressDialog.dismiss();
			} 
			progressDialog = null;
		} else { 
			Activity parent = (Activity) proxy.getActivity();
			parent.setProgressBarIndeterminate(false);
			parent.setProgressBarIndeterminateVisibility(false);
7
CodeRank
This code example shows how to use the following methods:removeMessages, sendEmptyMessage
This code example shows how to use the following methods:removeMessages, sendEmptyMessage
     *  
     * @param message the message to set 
     */ 
    private void setNextMessage(int message) {
        clearMessages(); 
        animationHandler.sendEmptyMessage(message);
    } 
 
    /** 
     * Clears messages from queue 
     */ 
    private void clearMessages() { 
        animationHandler.removeMessages(MESSAGE_SCROLL);
        animationHandler.removeMessages(MESSAGE_JUSTIFY);
    } 
     
    // animation handler 
    private Handler animationHandler = new Handler() {
        public void handleMessage(Message msg) { 
            scroller.computeScrollOffset(); 
6
CodeRank
This code example shows how to use the following methods:hasMessages, removeMessages, sendEmptyMessage
 
        // Show notification when we start the timer 
        showNotification(); 
 
        mStart = System.currentTimeMillis();
        mHandler.removeMessages(0);
        mHandler.sendEmptyMessage(0);
         
        // Keep restarting until we stop the service 
        return START_STICKY;
    } 
 
    @Override 
    public void onDestroy() { 
        Log.i(TAG, "onDestroy");
        // Cancel the ongoing notification. 
        mNM.cancel(TIMER_NOTIFICATION);
         
        mHandler.removeMessages(0);
    } 

6
CodeRank
This code example shows how to use the following methods:removeMessages, sendEmptyMessage
 
	@Override 
	protected void drawableStateChanged() { 
		super.drawableStateChanged(); 
		int delta = isPressed()? 1 : -1;
		handler.removeMessages(-delta);
		handler.sendEmptyMessage(delta);
	} 
	 
	private Handler handler = new Handler() {
		@Override 
		public void handleMessage(Message msg) { 
			int what = msg.what; 
 
			level += what; 
			if (level >= 0 && level < transitionDrawableLength) { 
				transitionDrawable.setLevel(level); 
		        if (colors != null) { 
		        	setTextColor(colors[level]); 
		        } 
6
CodeRank
This code example shows how to use the following methods:obtainMessage, sendEmptyMessage, sendMessage
	} 
 
	public void run() { 
		try { 
			doDownload(lurl,lfilt,ltarget,lenc);
			handler.sendEmptyMessage(0);
		} catch (Exception e) {
			e.printStackTrace();
			handler.sendMessage(handler.obtainMessage(1,e.getMessage()));
		} 
	} 
	 
	private Handler handler = new Handler() {
			@Override 
			public void handleMessage(Message msg) { 
				pd.dismiss(); 
				if (msg.what == 0) { 
					AlertDialog alertDialog = new AlertDialog.Builder(me).create(); 
					alertDialog.setTitle("Success"); 
					alertDialog.setMessage("Lesson downloaded successfully.\n\nPress OK to go back to the list of available lessons.\n\n(You can press the back button from the list to go back to the lesson select screen)"); 
6
CodeRank
This code example shows how to use the following methods:removeMessages, sendEmptyMessage
     *  
     * @param message the message to set 
     */ 
    private void setNextMessage(int message) {
        clearMessages(); 
        animationHandler.sendEmptyMessage(message);
    } 
 
    /** 
     * Clears messages from queue 
     */ 
    private void clearMessages() { 
        animationHandler.removeMessages(MESSAGE_SCROLL);
        animationHandler.removeMessages(MESSAGE_JUSTIFY);
    } 
     
    // animation handler 
    private Handler animationHandler = new Handler() {
        public void handleMessage(Message msg) { 
            scroller.computeScrollOffset(); 
6
CodeRank
This code example shows how to use the following methods:obtainMessage, removeMessages, sendEmptyMessage, sendMessageDelayed
			mShowing = true;
			if (mShownListener != null)
				mShownListener.onShown();
		} 
		updatePausePlay(); 
		mHandler.sendEmptyMessage(SHOW_PROGRESS);
 
		if (timeout != 0) {
			mHandler.removeMessages(FADE_OUT);
			mHandler.sendMessageDelayed(mHandler.obtainMessage(FADE_OUT),
					timeout);
		} 
	} 
 
	public boolean isShowing() { 
		return mShowing;
	} 
 
	public void hide() { 
		if (mAnchor == null)
6
CodeRank
This code example shows how to use the following methods:sendEmptyMessage
 
        coreInit(ctx.getFilesDir().getPath(), ctx.getCacheDir().getPath());
    } 
 
    public static void wakeupMainDispatcher() { 
        courier.sendEmptyMessage(0);
    } 
 
 
    public static Bitmap createBitmap(int width, int height) {
        return Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
    } 
 
    public static void pushBitmap(final Bitmap b) {
 
        currentActivity.runOnUiThread(new Runnable() {
                public void run() { 
 
                    SurfaceHolder sh = sv.getHolder();
 
6
CodeRank
This code example shows how to use the following methods:sendEmptyMessage
		recaptchaHandler = recaptchaHandlerIn;
	} 
 
	public void notifyNeed() { 
		if (recaptchaHandler != null) {
			recaptchaHandler.sendEmptyMessage(1);
		} 
	} 
 
	public synchronized void waitForUser() { 
		try { 
			wait();
		} catch (InterruptedException e) {
			Log.w(cgSettings.tag, "searchThread is not waiting for user...");
		} 
	} 
 
	public void setChallenge(String challenge) {
		recaptchaChallenge = challenge;
	} 
6
CodeRank

Related Handler sendEmptyMessage Questions & Answers:

sendEmptyMessage Method Overview
Sends a Message containing only the what value.
See Code Examples for other Android Handler Methods: