public boolean sheetRemoveFragment() {
        //check activity state
        if (isFinishing() || isDestroyed()) {
            return false;
        }
        clearSheetInfo();
        final FragmentManager fm = getSupportFragmentManager();
        final Fragment f1 = fm.findFragmentByTag(TAG_MAPDETAILS_FRAGMENT);
        if (f1 != null) {
            try {
                fm.beginTransaction().remove(f1).commitNowAllowingStateLoss();
            } catch (IllegalStateException ignore) {
                // ignore fm error on sheet removal
            }
        }
        final Fragment f2 = fm.findFragmentByTag(TAG_SWIPE_FRAGMENT);
        if (f2 != null) {
            try {
                fm.beginTransaction().remove(f2).commitNowAllowingStateLoss();
            } catch (IllegalStateException ignore) {
                // ignore fm error on sheet removal
            }
        }
        final FrameLayout v = findViewById(R.id.detailsfragment);
        if (v != null && v.getVisibility() != View.GONE) {

            final CoordinatorLayout.Behavior<?> behavior = ((CoordinatorLayout.LayoutParams) v.getLayoutParams()).getBehavior();
            if (behavior instanceof BottomSheetBehavior) {
                final BottomSheetBehavior<FrameLayout> b = BottomSheetBehavior.from(v);
                b.setState(BottomSheetBehavior.STATE_HIDDEN); // close correctly as it will otherwise conflict with up-swipe behaviour implementation
            }

            v.setVisibility(View.GONE);
            return true;
        }
        return false;
    }
removes fragment and view for mapdetails view; returns true, if view got removed
main/src/main/java/cgeo/geocaching/activity/AbstractNavigationBarMapActivity.java