خرید بک لینک

Vote count: -2

I'm having a problem when working with custom ArrayLists and trying to move them between activities. First I've declared a custom ArrayList in my first activity:

private ArrayList<String[]> dataArray = new ArrayList<String[]>();

Where each element of the ArrayList is an array of String elements.

Next, I put it into an intent with putExtra():

Intent int1 = new Intent(this, ManualModeActivity.class);
int1.putExtra(EXTRA_MESSAGE, csvArray);

Then, when I try to recover the ArrayList in my second Activity, I find that there's only a getStringArrayListExtra() method for ArrayList<String> elements, so it doesn't work with ArrayList<String[]>. I've been searching about this and all I find are examples with custom objects where the solution is to implement a Parcelable or Serialize interface on them. How could I do this with a "default" object like String[]? (Or maybe am I missing something about how interfaces works since I'm still a newbie in java?)

asked 3 mins ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 12 فروردين 1395 ساعت: 17:59

صفحه بندی