Code example for Handler

Methods: sendEmptyMessage

0
		mImage.setVisibility(View.GONE);
		new Thread() {
			public void run() { 
				try { 
					mDrawable = getDrawableFromURL(imageUrl);
					imageLoadedHandler.sendEmptyMessage(COMPLETE);
				} catch (MalformedURLException e) {
					imageLoadedHandler.sendEmptyMessage(FAILED);
				} catch (IOException e) {
					imageLoadedHandler.sendEmptyMessage(FAILED);
				} 
			}; 
		}.start();
	} 
 
	private final Handler imageLoadedHandler = new Handler(
			new Handler.Callback() { 
 
				@Override 
				public boolean handleMessage(Message msg) { 
					switch (msg.what) {