-------- Fragment1默认打开,然后再由Activity打开Fragment2
Fragment1
public class Fragment1 extends Fragment {
private static final String TAG = Fragment1.class.getSimpleName();
@Override
public void onAttach(Context context) {
super.onAttach(context);
Log.i(TAG, "onAttach: 1111111111111111111111");
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.i(TAG, "onCreate: 1111111111111111111111111111");
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
Log.i(TAG, "onCreateView: 111111111111111111111111111111");
return inflater.inflate(R.layout.layout_fm1, container, false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
Log.i(TAG, "onViewCreated: 111111111111111111111111111111111");
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
Log.i(TAG, "onActivityCreated: 111111111111111111111111111111111");
}
@Override
public void onStart() {
super.onStart();
Log.i(TAG, "onStart: 11111111111111111111111111111111111111");
}
@Override
public void onResume() {
super.onResume();
Log.i(TAG, "onResume: 11111111111111111111111111111111111111");
}
@Override
public void onPause() {
super.onPause();
Log.i(TAG, "onPause: 11111111111111111111111111111111111");
}
@Override
public void onStop() {
super.onStop();
Log.i(TAG,