Back to project page simple-dash.
The source code is released under:
MIT License
If you think the Android project simple-dash listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.bmdtech.simpledash.handler; //from w w w .ja v a2 s. c o m import android.os.Handler; import android.os.Looper; import android.os.Message; import android.util.Log; import org.bmdtech.simpledash.activity.UpdatableActivity; import org.bmdtech.simpledash.event.BaseEvent; import static org.bmdtech.simpledash.utils.Logging.logEvent; public final class AndroidMessageHandler extends Handler { private static final String TAG = "MH"; private final UpdatableActivity updatableActivity; public AndroidMessageHandler(UpdatableActivity updatableActivity) { super(Looper.getMainLooper()); this.updatableActivity = updatableActivity; } @Override public void handleMessage(final Message msg) { if (msg.obj != null && msg.obj instanceof BaseEvent) { BaseEvent event = (BaseEvent) msg.obj; logEvent(TAG, event); updatableActivity.update(event); } else { super.handleMessage(msg); } } }