package com.ahau.againstpestinfo.view;

import android.app.Activity;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;

import com.ahau.againstpestinfo.presenter.BasePresenter;

/**
 * 注释:
 *
 * @author fanchunchun
 * @date 2018/4/6
 */

public abstract class BaseActivity<V, T extends BasePresenter<V>> extends FragmentActivity {
//表示层的引用
    public T isearchPresenter;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        isearchPresenter = createPresenter();
        isearchPresenter.attachView((V) this);
    }

    protected abstract T createPresenter();

    @Override
    protected void onDestroy() {
        super.onDestroy();
        isearchPresenter.detchView();
    }
}
