(Android) What are these variable?

Issue

source: this post

//Retrieve the values
Set<String> set = myScores.getStringSet("key", null);

//Set the values
Set<String> set = new HashSet<String>();
set.addAll(listOfExistingScores);
scoreEditor.putStringSet("key", set);
scoreEditor.commit();
  • is myScores refers to sharedpreference?
  • what is listOfExistingScores refers to? is it ArrayList?
  • is scoreEditor refers to ArrayList? or ListView? or custom ListView?

Solution

According to that answser you can say that those three variable defines following things :

myScores :

As you said in op, it’s shared preference variable. It holdes sharedpreference.

listOfExistingScores :

It refers to the array declared by user. It is stored in hashset.

scoreEditor :

Score editor is sharedpreferences editor. You can read more details about it by given link.

Answered By – Ashish

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published