Code example for ResultReceiver

Methods: send

0
		resultReceiver = (ResultReceiver) intent.getParcelableExtra("com.merybere.app.EXTRA_MYRESULTRECEIVER");
		 
		// Comprobar que nos han pasado el resultReceiver, para evitar null pointer exception 
		if(resultReceiver != null) {
			// Al arrancar, mandar un result code 1 
			resultReceiver.send(1, null);
		} 
		 
		Dummy heavyTask = new Dummy();
		heavyTask.hardWork();
 
		if(resultReceiver != null) {
			resultReceiver.send(0, null);
		} 
	} 
 
	@Override 
	public void onCreate() { 
		Log.d(TAG, "onCreate");
		super.onCreate(); 
	}