1. onAttach ------called once the fragment is associated with its activity 2. onCreate-------called to do initial creation of the fragment 3. onCreateView---creates and returns the view hierarchy associated with the fragment 4.onActivityCreated ---te…
使用Fragment 官方例子中显示: 例如:一个学生Fragment,需要传入studentId,进行http请求显示,那么setArguments后防止杀掉Fragment后,参数为0,显示不了数据. public static StudentFragment newInstance(int studentId){ StudentFragment fragment = new StudentFragment(); Bundle bundle = new Bundle(); bundle.pu…