i have two activities named “Activity A” and “Activity B”. In my Activity A i need to pass Arraylist<BeanClass> to Activity B. Here is Activity A code….
Arraylist<BeanClass> list;
list.add(new BeanClass(nm, Add, Phn));
Intent i = new Intent(Activity A.this,Activity B.class);
now how to pass list to next activity and receive it as well…
Here is a BeanClass.java
public class BeanClass
{
String name,address,phone;
BeanClass(String name,String address,String phone)
{
this.name=name;
this.address=address;
this.phone=phone;
}
}
You have to make
BeanClassclass to serializable.Prepare the
Listand pass it viaIntent.putExtra()And receive the
ListinNextActivity's onCreatemethod