In the first activity I have an ArrayList that has to be passed to a second activity.
this is the first activity:
public ArrayList<ItemContact> selectedContacts = new ArrayList<>(); //filled in the rest of the code
Intent intent = new Intent(this, SummaryActivity.class);
Bundle bundle = new Bundle();
bundle.putSerializable("selectedContacts", selectedContacts);
intent.putExtra("selectedContacts", bundle);
startActivity(intent);
In the second activity:
ArrayList<ItemContact> selectedContacts = new ArrayList<>();
selectedContacts = (ArrayList<ItemContact>)getIntent().getExtras().getSerializable("selectedContacts") ;
The problem is that selectedContacts in the second activity is always null How can i fix it?
EDIT: ItemContact already implements Serializable but still doesn't work