@@ -0,0 +1,2090 @@
+package com.naijab.nextzytimeline.base;%0A%0Aimport android.os.Bundle;%0Aimport android.os.PersistableBundle;%0Aimport android.support.annotation.Nullable;%0Aimport android.support.v7.app.AppCompatActivity;%0Aimport com.naijab.nextzytimeline.base.exception.MvpPresenterNotCreateException;%0A%0A/**%0A * Created by Xiltron on 16/5/2560.%0A */%0A%0Apublic abstract class BaseMvpActivity%3CP extends BaseMvpInterface.Presenter%3E%0A    extends AppCompatActivity%0A    implements BaseMvpInterface.View %7B%0A%0A  private P presenter;%0A%0A  @SuppressWarnings(%22unchecked%22)%0A  @Override%0A  public void onCreate(@Nullable Bundle savedInstanceState,%0A      @Nullable PersistableBundle persistentState) %7B%0A    super.onCreate(savedInstanceState, persistentState);%0A    presenter = createPresenter();%0A    presenter.attachView(this);%0A    int layoutResID = getLayoutView();%0A    if ( getLayoutView() == 0);%0A    setContentView(layoutResID);%0A    bindView();%0A    setupInstance();%0A    setupView();%0A    getPresenter().onViewCreate();%0A    if (savedInstanceState == null)%7B%0A      initialize();%0A    %7D%0A%0A  %7D%0A%0A  @Override%0A  protected void onStart() %7B%0A    super.onStart();%0A    getPresenter().onViewStart();%0A  %7D%0A%0A  @Override%0A  protected void onStop() %7B%0A    super.onStop();%0A    getPresenter().onViewStop();%0A  %7D%0A%0A  @Override%0A  protected void onDestroy() %7B%0A    super.onDestroy();%0A    getPresenter().onViewDestroy();%0A    presenter.detachView();%0A  %7D%0A%0A  @Override%0A  public P getPresenter() %7B%0A    if (presenter != null) return presenter;%0A    throw new MvpPresenterNotCreateException();%0A  %7D%0A%0A  @Override%0A  protected void onSaveInstanceState(Bundle outState) %7B%0A    super.onSaveInstanceState(outState);%0A  %7D%0A%0A  @Override%0A  protected void onRestoreInstanceState(Bundle savedInstanceState) %7B%0A    super.onRestoreInstanceState(savedInstanceState);%0A    restoreView(savedInstanceState);%0A  %7D%0A%0A  public void restoreView(Bundle savedInstanceState) %7B%7D%0A%0A  public abstract P createPresenter();%0A%0A  public abstract int getLayoutView();%0A%0A  public abstract void bindView();%0A%0A  public abstract void setupInstance();%0A%0A  public abstract void setupView();%0A%0A  public abstract void initialize();%0A%7D%0A

Add Base MVP Activity