-3

var listPackets = ArrayList<IntArray>() How do I pass list packets from one activity to another activity

1 Answers1

0

Passing a List from one Activity to another

Example:

ArrayList<String> myList = new ArrayList<String>();
intent.putExtra("mylist", myList);

In the other Activity:

ArrayList<String> myList = (ArrayList<String>) getIntent().getSerializableExtra("mylist");
Jie Xu
  • 99
  • 8
  • If arraylist is less in size it works fine, But i have more than 10000 data and each item string length is around 45 characters. If arraylist size is less than 2500 then it works fine – Vinayak Moger Dec 15 '20 at 05:12
  • https://stackoverflow.com/a/58153000/7373632 see the answer – Jie Xu Jan 11 '21 at 03:12