app/src/main/java/fr/free/nrw/commons/category/CategorizationFragment.java
public void showBackButtonDialog() {
        new AlertDialog.Builder(getActivity())
                .setMessage("Are you sure you want to go back? The image will not "
                        + "have any categories saved.")
                .setTitle("Warning")
                .setPositiveButton(android.R.string.no, (dialog, id) -> {
                    //No need to do anything, user remains on categorization screen
                })
                .setNegativeButton(android.R.string.yes, (dialog, id) -> getActivity().finish())
                .create()
                .show();
    }
/**
     * Show dialog asking for confirmation to leave without saving categories.
     */
Show dialog asking for confirmation to leave without saving categories.
Show dialog asking for confirmation to leave without saving categories .
public void showBackButtonDialog() {
        new AlertDialog.Builder(getActivity())
                .setMessage("Are you sure you want to go back? The image will not "
                        + "have any categories saved.")
                .setTitle("Warning")
                .setPositiveButton(android.R.string.no, (dialog, id) -> {
                })
                .setNegativeButton(android.R.string.yes, (dialog, id) -> getActivity().finish())
                .create()
                .show();
    }
public void showBackButtonDialog ( ) { new AlertDialog . Builder ( getActivity ( ) ) . setMessage ( "Are you sure you want to go back? The image will not " + "have any categories saved." ) . setTitle ( "Warning" ) . setPositiveButton ( android . R . string . no , ( dialog , id ) -> { } ) . setNegativeButton ( android . R . string . yes , ( dialog , id ) -> getActivity ( ) . finish ( ) ) . create ( ) . show ( ) ; }
Show dialog asking for confirmation to leave without saving categories.
Show dialog asking for confirmation to leave without saving categories .
//No need to do anything, user remains on categorization screen