import android.content.Contextimport android.os.Bundleimport android.support.v4.app.Fragmentimport android.util.Logimport android.view.LayoutInflaterimport android.view.Viewimport android.view.ViewGroup/** * Created by zhangwei on 2017/7/10. */abstract class BaseFragment : Fragment() { private final val TAG = "BaseFragment" override fun onAttach(context: Context?) { super.onAttach(context) Log.d(TAG,"onAttach") } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) Log.d(TAG,"onCreate") } override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? { return super.onCreateView(inflater, container, savedInstanceState) Log.d(TAG,"onCreateView") } override fun onActivityCreated(savedInstanceState: Bundle?) { super.onActivityCreated(savedInstanceState) Log.d(TAG,"onActivityCreated") } override fun onStart() { super.onStart() Log.d(TAG,"onStart") } override fun onResume() { super.onResume() Log.d(TAG,"onResume") } override fun onPause() { super.onPause() Log.d(TAG,"onPause") } override fun onStop() { super.onStop() Log.d(TAG,"onStop") } override fun onDestroyView() { super.onDestroyView() Log.d(TAG,"onDestroyView") } override fun onDestroy() { super.onDestroy() Log.d(TAG,"onDestroy") } override fun onDetach() { super.onDetach() Log.d(TAG,"onDetach") } override fun onHiddenChanged(hidden: Boolean) { super.onHiddenChanged(hidden) Log.d(TAG,"onHiddenChanged") } override fun setUserVisibleHint(isVisibleToUser: Boolean) { super.setUserVisibleHint(isVisibleToUser) Log.d(TAG,"setUserVisibleHint") }}