SHARE
TWEET

Untitled

a guest Jun 24th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SharedPreferences.Editor editor = getSharedPreferences("saving", MODE_PRIVATE).edit();
  2.  editor.putString("sort", "by name");
  3.  editor.apply();
  4.      
  5. SharedPreferences prefs = getSharedPreferences("saving", MODE_PRIVATE);
  6.  
  7.   String sorting= prefs.getString("sort", "No name defined");//"No name defined" is the default value.
  8.      
  9. if (sorting.equals("by name")){
  10. // do something
  11. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top