X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/FreeShisen/blobdiff_plain/d0e04237b00df7c11616f359200255a8b47e79d7..42aa846accf450791edf0b254db044867179eb41:/src/de/cwde/shisensho/ShisenSho.java diff --git a/src/de/cwde/shisensho/ShisenSho.java b/src/de/cwde/shisensho/ShisenSho.java index 8fe7d30..654e4e0 100644 --- a/src/de/cwde/shisensho/ShisenSho.java +++ b/src/de/cwde/shisensho/ShisenSho.java @@ -1,7 +1,8 @@ package de.cwde.shisensho; import android.app.Application; -import android.os.Bundle; +import android.content.SharedPreferences; +import android.preference.PreferenceManager; import android.util.Log; public class ShisenSho extends Application { @@ -70,22 +71,16 @@ public class ShisenSho extends Application { @Override public void onCreate() { super.onCreate(); + PreferenceManager.setDefaultValues(this, R.xml.preferences, false); } - public Bundle getOptions() { - Bundle options = new Bundle(); - options.putInt("size", size); - options.putInt("difficulty", difficulty); - options.putBoolean("gravity", gravity); - options.putBoolean("timeCounter", timeCounter); - return options; - } - - public void setOptions(Bundle options) { - int size = options.getInt("size"); - int difficulty = options.getInt("difficulty"); - boolean gravity = options.getBoolean("gravity"); - boolean timeCounter = options.getBoolean("timeCounter"); + public void setOptions() { + SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this); + + int size = sharedPref.getInt("size", 1); + int difficulty = sharedPref.getInt("difficulty", 1); + boolean gravity = sharedPref.getBoolean("gravity", true); + boolean timeCounter = sharedPref.getBoolean("timeCounter", true); boolean needsReset = false;