package de.tudarmstadt.informatik.hostage.logging;

import android.os.Bundle;
import android.os.Handler;
import android.os.ResultReceiver;

public class LogResultReceiver extends ResultReceiver {

	public interface Receiver {
		public void onReceiveResult(int resultCode, Bundle resultData);
	}

	private Receiver mReceiver;

	public LogResultReceiver(Handler handler) {
		super(handler);
	}

	public void setReceiver(Receiver receiver) {
		mReceiver = receiver;
	}

	@Override
	protected void onReceiveResult(int resultCode, Bundle resultData) {
		if (mReceiver != null) {
			mReceiver.onReceiveResult(resultCode, resultData);
		}
	}

}
