content: package com.aishang5wpj.zhuangbimaster.app;
  
  import android.os.Bundle;
  import android.support.annotation.Nullable;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.Toast;
  
  /**
   * Created by wpj on 16/6/7下午5:57.
   */
  public abstract class MvpFragment<V extends BaseView, P extends BasePresenter<V>> extends BaseFragment implements
          BaseView {
  
      protected P mPresenter;
  
      @Nullable
      @Override
      public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle
              savedInstanceState) {
          mPresenter = createPresenter(this);
          return super.onCreateView(inflater, container, savedInstanceState);
      }
  
      protected abstract P createPresenter(BaseView view);
  
      @Override
      public void onDestroy() {
          mPresenter.onDestory();
          super.onDestroy();
      }
  
      @Override
      public void showLoading() {
  
      }
  
      @Override
      public void hideLoading() {
  
      }
  
      @Override
      public void showToast(String msg) {
  
          Toast.makeText(getContext(), msg, Toast.LENGTH_SHORT).show();
      }
  }
  