mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-29 19:20:48 +00:00
[Android] Add a handler for the global config CheckBoxPreference.
This commit is contained in:
parent
1105304df5
commit
2770b23e9f
@ -2,8 +2,13 @@ package org.retroarch.browser.preferences.fragments;
|
||||
|
||||
import org.retroarch.R;
|
||||
import org.retroarch.browser.preferences.fragments.util.PreferenceListFragment;
|
||||
import org.retroarch.browser.preferences.util.UserPreferences;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.preference.CheckBoxPreference;
|
||||
import android.preference.Preference;
|
||||
import android.preference.Preference.OnPreferenceClickListener;
|
||||
|
||||
/**
|
||||
* A {@link PreferenceListFragment} that handles the general settings.
|
||||
@ -17,5 +22,17 @@ public final class GeneralPreferenceFragment extends PreferenceListFragment
|
||||
|
||||
// Add general preferences from the XML.
|
||||
addPreferencesFromResource(R.xml.general_preferences);
|
||||
|
||||
// Set a listener for the global configuration checkbox.
|
||||
final CheckBoxPreference usingGlobalConfig = (CheckBoxPreference) findPreference("global_config_enable");
|
||||
usingGlobalConfig.setOnPreferenceClickListener(new OnPreferenceClickListener(){
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference)
|
||||
{
|
||||
UserPreferences.updateConfigFile(getActivity());
|
||||
UserPreferences.readbackConfigFile(getActivity());
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user