mirror of
https://github.com/libretro/RetroArch
synced 2025-02-07 03:40:24 +00:00
Merge pull request #1225 from lioncash/android
Android: Use apply instead of commit for applying SharedPreference changes
This commit is contained in:
commit
21ad0d4300
@ -45,7 +45,7 @@ public final class DisplayRefreshRateTest extends Activity {
|
||||
SharedPreferences prefs = UserPreferences.getPreferences(DisplayRefreshRateTest.this);
|
||||
SharedPreferences.Editor edit = prefs.edit();
|
||||
edit.putString("video_refresh_rate", Double.toString(fps));
|
||||
edit.commit();
|
||||
edit.apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -252,7 +252,7 @@ public class DirectoryFragment extends DialogFragment
|
||||
SharedPreferences settings = UserPreferences.getPreferences(getActivity());
|
||||
SharedPreferences.Editor editor = settings.edit();
|
||||
editor.putString(pathSettingKey, path);
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
if (onClosedListener != null)
|
||||
|
@ -45,7 +45,7 @@ public final class MainMenuActivity extends FragmentActivity
|
||||
SharedPreferences.Editor edit = prefs.edit();
|
||||
edit.putString("libretro_path", core_path);
|
||||
edit.putString("libretro_name", core_name);
|
||||
edit.commit();
|
||||
edit.apply();
|
||||
|
||||
// Set the title section to contain the name of the selected core.
|
||||
setCoreTitle(core_name);
|
||||
|
@ -78,7 +78,7 @@ public final class MainMenuFragment extends PreferenceListFragment implements On
|
||||
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx);
|
||||
if (!prefs.getBoolean("first_time_refreshrate_calculate", false))
|
||||
{
|
||||
prefs.edit().putBoolean("first_time_refreshrate_calculate", true).commit();
|
||||
prefs.edit().putBoolean("first_time_refreshrate_calculate", true).apply();
|
||||
|
||||
AlertDialog.Builder alert = new AlertDialog.Builder(ctx)
|
||||
.setTitle(R.string.welcome_to_retroarch)
|
||||
|
@ -48,7 +48,7 @@ public final class VideoPreferenceFragment extends PreferenceListFragment implem
|
||||
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
||||
final SharedPreferences.Editor edit = prefs.edit();
|
||||
edit.putString("video_refresh_rate", Double.toString(rate));
|
||||
edit.commit();
|
||||
edit.apply();
|
||||
|
||||
Toast.makeText(getActivity(), String.format(getString(R.string.using_os_reported_refresh_rate), rate), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ public final class UserPreferences
|
||||
readbackBool(config, edit, "savefile_directory_enable"); // Ignored by RetroArch
|
||||
readbackBool(config, edit, "savestate_directory_enable"); // Ignored by RetroArch
|
||||
|
||||
edit.commit();
|
||||
edit.apply();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -162,7 +162,7 @@ public class RetroActivityCamera extends RetroActivityCommon
|
||||
SharedPreferences prefs = UserPreferences.getPreferences(this);
|
||||
SharedPreferences.Editor edit = prefs.edit();
|
||||
edit.putBoolean("CAMERA_UPDATES_ON", false);
|
||||
edit.commit();
|
||||
edit.apply();
|
||||
|
||||
camera_service_running = false;
|
||||
|
||||
@ -176,7 +176,7 @@ public class RetroActivityCamera extends RetroActivityCommon
|
||||
SharedPreferences prefs = UserPreferences.getPreferences(this);
|
||||
SharedPreferences.Editor edit = prefs.edit();
|
||||
edit.putBoolean("CAMERA_UPDATES_ON", camera_service_running);
|
||||
edit.commit();
|
||||
edit.apply();
|
||||
|
||||
onCameraStop();
|
||||
super.onPause();
|
||||
@ -203,7 +203,7 @@ public class RetroActivityCamera extends RetroActivityCommon
|
||||
else // Otherwise, turn off camera updates
|
||||
{
|
||||
edit.putBoolean("CAMERA_UPDATES_ON", false);
|
||||
edit.commit();
|
||||
edit.apply();
|
||||
camera_service_running = false;
|
||||
}
|
||||
super.onResume();
|
||||
|
@ -276,7 +276,7 @@ implements ConnectionCallbacks, OnConnectionFailedListener, LocationListener
|
||||
SharedPreferences prefs = UserPreferences.getPreferences(this);
|
||||
SharedPreferences.Editor edit = prefs.edit();
|
||||
edit.putBoolean("LOCATION_UPDATES_ON", mUpdatesRequested);
|
||||
edit.commit();
|
||||
edit.apply();
|
||||
|
||||
super.onPause();
|
||||
}
|
||||
@ -300,7 +300,7 @@ implements ConnectionCallbacks, OnConnectionFailedListener, LocationListener
|
||||
else // Otherwise, turn off location updates
|
||||
{
|
||||
edit.putBoolean("LOCATION_UPDATES_ON", false);
|
||||
edit.commit();
|
||||
edit.apply();
|
||||
location_service_running = false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user