How can I pass a multidimensional array from one activity to another?
+2
A:
You can create a Serializable
class which wraps the two-dimensional array, and pass it using Intent.putExtra(String name, Serializable value)
codelark
2010-10-26 13:21:02
I have to pass a 2-d string array. Can u please give some example of how to pass and retrieve the array using Intent.putExtra(String name, Serializable value)
Maya
2010-10-26 13:25:10
Reuben Scratton
2010-10-26 13:44:23
Of course, if you have thousands of strings this might be too slow. You could implement your own scheme to condense your array to a single String (e.g. joining the elements together with some character sequence that's guaranteed to not appear in the array content).
Reuben Scratton
2010-10-26 13:47:43
If you're passing thousands of strings, using any of the persistance strategies and passing the id to retrieve them would be a less-crazy thing to do.
codelark
2010-10-26 13:49:46