Skip to content

Latest commit

 

History

History
35 lines (29 loc) · 779 Bytes

README.md

File metadata and controls

35 lines (29 loc) · 779 Bytes

Settings.java

SharedPreferences just got a whole lot better!

Usage

Settings settings;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    settings = new SettingsActivity(getApplicationContext());
}

Get Settings

settings.getBool("myBoolean");
settings.getFloat("myFloat");
settings.getInt("myInteger");
settings.getLong("myLong");
settings.getString("myString");
settings.getStringSet("myStringSet");

Set Settings

settings.setBool("myBoolean", true);
settings.setFloat("myFloat", 0.7564);
settings.setInt("myInteger", 132);
settings.setLong("myLong", 13234893487);
settings.setString("myString", "This is myString's value");
settings.setStringSet("myStringSet", null);