Tuesday 2 May 2017

Passing ArrayList through Intent to one Activity to another Activity in Android

Step1: Firstactivity.java set the array list in intent
ArrayList<String> images new ArrayList<>();
images.add("amit");
Intent i = new Intent(Firstactivity.this, Secondactivity.class);
i.putExtra("key"images);
startActivity(i);

STEP 2. Secondactivity.class receiving the array from intent
ArrayList<String> imageslist = (ArrayList<String>) getIntent().getSerializableExtra("key");