(Fragment fragment, boolean addToBackState)
| 733 | } |
| 734 | |
| 735 | @Override |
| 736 | public void startMainFragment(Fragment fragment, boolean addToBackState) { |
| 737 | Log.d(TAG, "MainActivity->FragmentListener->startMainFragment()"); |
| 738 | int container_id = R.id.fragment_container; |
| 739 | |
| 740 | if (isTwoPane()) { |
| 741 | findViewById(R.id.fragment_detail_container).setVisibility( |
| 742 | View.GONE); |
| 743 | Fragment detail = mFragment.findFragmentByTag("detail_fragment"); |
| 744 | if (detail != null && !mNewFragment && !detail.isInLayout()) { |
| 745 | startDetailFragment(recreateFragment(detail)); |
| 746 | } |
| 747 | |
| 748 | } |
| 749 | FragmentTransaction tran = mFragment.beginTransaction().replace( |
| 750 | container_id, fragment, "main_fragment"); |
| 751 | if (addToBackState) { |
| 752 | tran.addToBackStack(null); |
| 753 | } |
| 754 | tran.commitAllowingStateLoss(); |
| 755 | } |
| 756 | |
| 757 | @Override |
| 758 | public void startDetailFragment(Fragment fragment) { |
no test coverage detected