Back to project page wifi-auto-forget.
The source code is released under:
GNU General Public License
If you think the Android project wifi-auto-forget 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 com.cebesius.wifiautoforget.mvp; // w ww .j a v a2 s .c o m import android.text.TextUtils; import com.squareup.otto.Subscribe; /** * A presenter to handle global app behaviors */ public class AppPresenter { private final AppModel model; private final AppView view; public AppPresenter(AppModel model, AppView view) { this.model = model; this.view = view; } @Subscribe public void onShowToastEvent(ShowToastEvent event) { if (!TextUtils.isEmpty(event.message)) { view.showToast(event.message, event.length); } else if (event.messageResId != 0) { view.showToast(event.messageResId, event.length); } } public static class ShowToastEvent { private final String message; private final int messageResId; private final int length; public ShowToastEvent(String message, int length) { this.message = message; this.messageResId = 0; this.length = length; } public ShowToastEvent(int messageResId, int length) { this.message = null; this.messageResId = messageResId; this.length = length; } } }