Answers for "to persist a collection of key value data android"

4

android sharedpreferences

SharedPreferences sharedPref = getSharedPreferences("name", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();
editor.putString("key", "Value");
editor.commit();
Posted by: Guest on November-07-2020
0

android key value pair

Map <Integer,String> myMap = new HashMap<Integer,String>();

Iterator<Entry<Integer, String>> iterator = myMap.entrySet().iterator();
while (iterator.hasNext()) {
    Map.Entry<Integer,String> pairs = (Map.Entry<Integer,String>)iterator.next();
    String value =  pairs.getValue();
    Integer key = pairs.getKey();
    System.out.println(key +"--->"+value);
}
Posted by: Guest on November-05-2020

Code answers related to "to persist a collection of key value data android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language