app/src/main/java/fr/free/nrw/commons/category/CategoryImagesActivity.java
@Override
    protected void onResume() {
        if (supportFragmentManager.getBackStackEntryCount()==1){
            //FIXME: Temporary fix for screen rotation inside media details. If we don't call onBackPressed then fragment stack is increasing every time.
            //FIXME: Similar issue like this https://github.com/commons-app/apps-android-commons/issues/894
            onBackPressed();
        }
        super.onResume();
    }
/**
     * This method is called on backPressed when mediaDetailFragment is opened in the activity.
     */
This method is called on backPressed when mediaDetailFragment is opened in the activity.
This method is called on backPressed when mediaDetailFragment is opened in the activity .
@Override
    protected void onResume() {
        if (supportFragmentManager.getBackStackEntryCount()==1){
            onBackPressed();
        }
        super.onResume();
    }
@ Override protected void onResume ( ) { if ( supportFragmentManager . getBackStackEntryCount ( ) == 1 ) { onBackPressed ( ) ; } super . onResume ( ) ; }
This method is called on backPressed when mediaDetailFragment is opened in the activity.
This method is called on backPressed when mediaDetailFragment is opened in the activity .
//FIXME: Temporary fix for screen rotation inside media details. If we don't call onBackPressed then fragment stack is increasing every time. //FIXME: Similar issue like this https://github.com/commons-app/apps-android-commons/issues/894