Base Presenter

package com.zezekalo.newmf; import android.os.Bundle; import android.support.annotation.Nullable; public class BasePresenter<T extends BaseView> { @Nullable private T view; @Nullable public T getView() { return view; } public void create (Bundle savedState) { onCreate(savedState); } public void destroy() { onDestroy(); } public void takeView(T view) { this.view = view; onTakeView(view); } public void dropView() { onDropView(); this.view = null; } public void save(Bundle state) { onSave(state); } protected void onCreate(Bundle savedState) { } protected void onDestroy() { } protected void onTakeView(T view) { } protected void onDropView() { } protected void onSave(Bundle state) { } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.