use of com.peterlaurence.trekadvisor.menu.maplist.MapListFragment in project TrekAdvisor by peterLaurence.
the class MainActivity method createMapListFragment.
private Fragment createMapListFragment(FragmentTransaction transaction) {
Fragment mapListFragment = new MapListFragment();
transaction.add(R.id.content_frame, mapListFragment, MAP_LIST_FRAGMENT_TAG);
return mapListFragment;
}
use of com.peterlaurence.trekadvisor.menu.maplist.MapListFragment in project TrekAdvisor by peterLaurence.
the class MainActivity method showMapListFragment.
private void showMapListFragment() {
/* Remove single-usage fragments */
removeSingleUsageFragments();
/* Hide other fragments */
FragmentTransaction hideTransaction = fragmentManager.beginTransaction();
hideOtherFragments(hideTransaction, MAP_LIST_FRAGMENT_TAG);
hideTransaction.commit();
FragmentTransaction transaction = fragmentManager.beginTransaction();
Fragment mapListFragment = fragmentManager.findFragmentByTag(MAP_LIST_FRAGMENT_TAG);
/* Show the map list fragment if it exists */
if (mapListFragment == null) {
mapListFragment = createMapListFragment(transaction);
}
transaction.show(mapListFragment);
/* Manually manage the back action*/
mBackFragmentTag = MAP_FRAGMENT_TAG;
transaction.commit();
}
Aggregations