I have a set which contains a list of strings:
public Set<String> favs = new HashSet<>();
However when I start another activity 'Favorites' I want to pass this list over to my 'Favorties' class, currently I have:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
} else if (id == R.id.exit_the_app) {
finish();
return true;
} else if (id == R.id.favorites) {
Intent startfavs = (new Intent(Insulter.this, Favorites.class));
startActivity(startfavs);
return true;
}
return super.onOptionsItemSelected(item);
}
I want to pass this set in 'favorites' and eventually display it in a list view after changing it to a list. What would be the best way of going about doing this?
(Note: My second activity is all set up in the manifold and runs fine)