-3

In Android I want to pass set values to another activity..How Can I do that?

        Set<Person> persons=getPersons();

        Intent intent = new Intent(getApplicationContext(), MainActivity2.class);
        intent.putExtra("persons", persons);  //Here I am getting error

        startActivity(intent);

But I am getting error in intent.putExtra()..why?how Can I pass these set values?

Ravindra Kushwaha
  • 7,846
  • 14
  • 53
  • 103
user_apr
  • 719
  • 2
  • 10
  • 27

1 Answers1

0

You need to use implement parcable in class Person

For example

public class Person implements Paracable{


}
Zeeshan Shabbir
  • 6,704
  • 4
  • 38
  • 74