I am storing values in ArrayList
and pass it to using bundle to next Fragment
, and there I set values to my TextView
, till here it wor
An alternative solution (just thought of it):
If you have an array called addtos
and you want to add the array to shared preferences, since the variable is represented in the dictionary as a String, you could append the array index to the end of that string.
e.g -
Storing
for(int i = 0; i
Receiving
int i = 0;
while(true){
if(prefs.getString("addtos"+i, "")!=""){ // or whatever the default dict value is
// do something with it
i++;
}else{break;}
}
Seems ok to me, if anyone sees a problem with this, let me know.
Also, no need for ArrayLists