I'm working on one assignment in that I want to pass Array List to Next activity using Intent. I want to display the data in list View for that I created one adapter also,but the problem is how to pass array list in intent.
private ArrayList<ImageModel> test(){
ArrayList results = new ArrayList();
ImageModel newsData = new ImageModel();
newsData.setQuestions("Q1.who belongs to melanistic color variant of any Panthera species");
newsData.setImageView(R.drawable.ic_blackpanther);
results.add(newsData);
newsData = new ImageModel();
newsData.setQuestions("Q2.who can run faster than any other land animal");
newsData.setImageView(R.drawable.ic_chita);
results.add(newsData);
newsData = new ImageModel();
newsData.setQuestions("Q3.who is belongs to family Elephantidae and the order Proboscidea");
newsData.setImageView(R.drawable.ic_elephant);
results.add(newsData);
newsData = new ImageModel();
newsData.setQuestions("Q4.Which animal is historically used in warfare");
newsData.setImageView(R.drawable.ic_horse);
results.add(newsData);
newsData = new ImageModel();
newsData.setQuestions("Q5.Which animal is united by their distinctive black and white stripes on his body");
newsData.setImageView(R.drawable.ic_zebra);
results.add(newsData);
return results;
}