Utilizzo il pacchetto di supporto v4.Impossibile trovare il frammento per tag
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));
Restituisce sempre "frammento trovato: falso". Mi manca qualcosa di molto ovvio qui, cos'è?
E se si vuole _really_ di transazione da applicare, quindi usare [executePendingTransactions] (http://developer.android.com/reference/android/app/FragmentManager.html#executePendingTransactions()) –