This method add new object into ArrayList
//get text from textview
time = date.getText().toString();
entry_d = entry.getText().toString();
dayName = day.getText().toString();
arrayList.add( new ArrayObject( dayName, entry_d ,time));
I am trying to add these 3 strings in SharedPrefrences
. Here is my code:
private void savePreferences(String key, String value) {
SharedPreferences sharedPreferences = PreferenceManager
.getDefaultSharedPreferences(this);
Editor editor = sharedPreferences.edit();
editor.putBoolean(key, value);
editor.commit();
}
This method only add one string at a time where as I want to add 3 strings in one go. Is there any method I can implement.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…