Code example for Handler

Methods: obtainMessagesendMessage

0
	public boolean handleMessage(Message message)
	{ 
		switch (message.what) {
		case MSG_RUN_QUERY: {
			Cursor cursor = runQuery(mContext.getContentResolver());
			mUiHandler.sendMessage(mUiHandler.obtainMessage(MSG_UPDATE_CURSOR, cursor));
			break; 
		} 
		case MSG_UPDATE_CURSOR:
			changeCursor((Cursor)message.obj);
			break; 
		default: 
			return false; 
		} 
 
		return true; 
	} 
 
	/** 
	 * Query the playlist songs. 
	 *