-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,428
  • 13
  • 49
  • 95
soma
  • 35
  • 5

1 Answers1

0

You need to use implement parcable in class Person

For example

public class Person implements Paracable{


}
Zeeshan Shabbir
  • 6,095
  • 4
  • 33
  • 72