Putting ArrayList of ArrayList into a bundle, parcelable

436 views Asked by At

Hi i need to put an ArrayList < ArrayList< String>> in my class yet retain its parcebility

private ArrayList<ArrayList<String>> quotes;

I have tried

bundle.putParcelableArrayList(QUOTE_ARRAY, quotes);

i get 'quotes' underlined in red and it says "required: java.util.ArrayList< ?extends android.os.Parcel able>"

how can i make the ArrayList inside the parent ArrayList parcelable

1

There are 1 answers

0
wateryan On BEST ANSWER

Since an ArrayList is not a parcelable, I would suggest encapsulating the ArrayList of strings in an class that implements parcelable. Then just use an ArrayList containing that object type.