List of usage examples for android.app FragmentTransaction add
public abstract FragmentTransaction add(@IdRes int containerViewId, Fragment fragment);
From source file:com.bernard.beaconportal.activities.activity.MessageList.java
private void initializeFragments() { FragmentManager fragmentManager = getFragmentManager(); fragmentManager.addOnBackStackChangedListener(this); boolean hasMessageListFragment = (mMessageListFragment != null); if (!hasMessageListFragment) { FragmentTransaction ft = fragmentManager.beginTransaction(); mMessageListFragment = MessageListFragment.newInstance(mSearch, false, (K9.isThreadedViewEnabled() && !mNoThreading)); ft.add(R.id.message_list_container, mMessageListFragment); ft.commit();/*from w ww . j ava 2 s . c o m*/ } // Check if the fragment wasn't restarted and has a MessageReference in // the arguments. If // so, open the referenced message. if (!hasMessageListFragment && mMessageViewFragment == null && mMessageReference != null) { openMessage(mMessageReference); } }