Assuming that your List is a list of strings make data an ArrayList<String>
and use intent.putStringArrayListExtra("data", data)
Here is a skeleton of the code you need:
-
Declare List
private List<String> test;
-
Init List at appropriate place
test = new ArrayList<String>();
and add data as appropriate to
test
. -
Pass to intent as follows:
Intent intent = getIntent(); intent.putStringArrayListExtra("test", (ArrayList<String>) test);
-
Retrieve data as follows:
ArrayList<String> test = getIntent().getStringArrayListExtra("test");