我在执行时看到了
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
MyFragment myFragment = new MyFragment();
fragmentTransaction.replace(R.id.parent, myFragment, "MyFragment");
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
旧片段上没有调用任何方法。我试过:
- 停止();
- 暂停();
- onDestroy();
- onDetach();
没人叫,为什么?