我正在使用支持包v4。
mFragmentManager = getSupportFragmentManager();
FragmentTransaction ft = mFragmentManager.beginTransaction();
ft.add(R.id.fragContainer1, new ModelListFragment(), FRAG_MODEL_LIST);
ft.add(R.id.fragContainer2, new TrimListFragment(), FRAG_TRIM_LIST);
ft.commit();
Fragment fragment = mFragmentManager.findFragmentByTag(
MainActivity.FRAG_MODEL_LIST);
Log.d("MY", "found fragment: " + (fragment != null));
始终返回“found fragment:false”。我错过了一些非常明显的东西,它是什么?