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?
Asked
Active
Viewed 303 times
2 Answers
0
You can use putSerializable arrays are serializable.

Martin
- 2,146
- 4
- 21
- 32
-
putSerializable is not working in case of 2 Dimensional Arraylist – user3334206 Feb 20 '14 at 19:04
-
You should include some code or more detail to support your answer! – Paresh Mayani Feb 21 '14 at 12:44
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