Code example for Message

Methods: getData

0
 
	class IncomingHandler extends Handler {
		@Override 
		public void handleMessage(Message msg) {
			Log.e("MESSAGE", "Got message");
			Bundle data = msg.getData();
			String urlPath = data.getString(DownloadServiceMessenger.URLPATH);
			String fileName = data.getString(DownloadServiceMessenger.FILENAME);
			String outputPath = download(urlPath, fileName);
 
			Message backMsg = Message.obtain();
			backMsg.arg1 = result;
			Bundle bundle = new Bundle();
			bundle.putString(RESULTPATH, outputPath);
			backMsg.setData(bundle);
			try { 
				outMessenger.send(backMsg);
			} catch (android.os.RemoteException e1) {
				Log.w(getClass().getName(), "Exception sending message", e1);
			} 
		}