0

I have a 2 dimensional ArrayList and I want to pass it from one activity to another activity in an android application. How can I do it?

2 Answers2

0

You can use putSerializable arrays are serializable.

Martin
  • 2,146
  • 4
  • 21
  • 32
0

You can do that by creating a static variable in any class that can be something kind of (Tools class) and stock your nDim array and use it where you want, or create your custom class that must implement Parcelable interface, more details here from android master.

http://developer.android.com/reference/android/os/Parcelable.html

And after this while passing the data to the Intent as extras, use

intent.putStringArrayListExtra("arry_extra", arrayList);

and recieve the same in the other Activity using,

arrayList = intent.getStringArrayListExtra("arry_extra");
Community
  • 1
  • 1
Smile2Life
  • 1,921
  • 3
  • 16
  • 30