package com.luyh.mytest;

import android.support.v4.app.Fragment;

/**
 * Created by luyh on 2016/4/5.
 */
public class BaseFragment extends Fragment {

    //Fragment延迟加载解决方案
    @Override
    public void setUserVisibleHint(boolean isVisibleToUser) {
        super.setUserVisibleHint(isVisibleToUser);

        if(getUserVisibleHint()){
            onVisible();
        } else {
            onInvisible();
        }
    }

    protected void onVisible(){

    }

    protected void onInvisible(){

    }
}
