// Path: app/src/main/java/rkr/simplekeyboard/inputmethod/latin/utils/FragmentUtils.java
// public class FragmentUtils {
//     private static final HashSet<String> sLatinImeFragments = new HashSet<>();
//     static {
//         sLatinImeFragments.add(PreferencesSettingsFragment.class.getName());
//         sLatinImeFragments.add(KeyPressSettingsFragment.class.getName());
//         sLatinImeFragments.add(AppearanceSettingsFragment.class.getName());
//         sLatinImeFragments.add(ThemeSettingsFragment.class.getName());
//         sLatinImeFragments.add(SettingsFragment.class.getName());
//         sLatinImeFragments.add(LanguagesSettingsFragment.class.getName());
//         sLatinImeFragments.add(SingleLanguageSettingsFragment.class.getName());
//     }
// 
//     public static boolean isValidFragment(String fragmentName) {
//         return sLatinImeFragments.contains(fragmentName);
//     }
// }


import android.app.ActionBar;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.util.Log;
import android.view.MenuItem;
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
import rkr.simplekeyboard.inputmethod.R;
import rkr.simplekeyboard.inputmethod.latin.utils.FragmentUtils;
        super.onCreate(savedState);
        final ActionBar actionBar = getActionBar();
        if (actionBar != null) {
            actionBar.setDisplayHomeAsUpEnabled(true);
            actionBar.setHomeButtonEnabled(true);
        }
    }

    @Override
    public boolean onOptionsItemSelected(final MenuItem item) {
        if (item.getItemId() == android.R.id.home) {
            super.onBackPressed();
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    @Override
    public Intent getIntent() {
        final Intent intent = super.getIntent();
        final String fragment = intent.getStringExtra(EXTRA_SHOW_FRAGMENT);
        if (fragment == null) {
            intent.putExtra(EXTRA_SHOW_FRAGMENT, DEFAULT_FRAGMENT);
        }
        intent.putExtra(EXTRA_NO_HEADERS, true);
        return intent;
    }

    @Override
    public boolean isValidFragment(final String fragmentName) {
// Path: app/src/main/java/rkr/simplekeyboard/inputmethod/latin/utils/FragmentUtils.java
// public class FragmentUtils {
//     private static final HashSet<String> sLatinImeFragments = new HashSet<>();
//     static {
//         sLatinImeFragments.add(PreferencesSettingsFragment.class.getName());
//         sLatinImeFragments.add(KeyPressSettingsFragment.class.getName());
//         sLatinImeFragments.add(AppearanceSettingsFragment.class.getName());
//         sLatinImeFragments.add(ThemeSettingsFragment.class.getName());
//         sLatinImeFragments.add(SettingsFragment.class.getName());
//         sLatinImeFragments.add(LanguagesSettingsFragment.class.getName());
//         sLatinImeFragments.add(SingleLanguageSettingsFragment.class.getName());
//     }
// 
//     public static boolean isValidFragment(String fragmentName) {
//         return sLatinImeFragments.contains(fragmentName);
//     }
// }


// Path: app/src/main/java/rkr/simplekeyboard/inputmethod/latin/settings/SettingsActivity.java
import android.app.ActionBar;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.util.Log;
import android.view.MenuItem;
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
import rkr.simplekeyboard.inputmethod.R;
import rkr.simplekeyboard.inputmethod.latin.utils.FragmentUtils;

        super.onCreate(savedState);
        final ActionBar actionBar = getActionBar();
        if (actionBar != null) {
            actionBar.setDisplayHomeAsUpEnabled(true);
            actionBar.setHomeButtonEnabled(true);
        }
    }

    @Override
    public boolean onOptionsItemSelected(final MenuItem item) {
        if (item.getItemId() == android.R.id.home) {
            super.onBackPressed();
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    @Override
    public Intent getIntent() {
        final Intent intent = super.getIntent();
        final String fragment = intent.getStringExtra(EXTRA_SHOW_FRAGMENT);
        if (fragment == null) {
            intent.putExtra(EXTRA_SHOW_FRAGMENT, DEFAULT_FRAGMENT);
        }
        intent.putExtra(EXTRA_NO_HEADERS, true);
        return intent;
    }

    @Override
    public boolean isValidFragment(final String fragmentName) {
        return FragmentUtils.isValidFragment(fragmentName);