android parcelable string array

Saideira picture Saideira · Oct 26, 2010 · Viewed 14.4k times · Source

I have

ArrayList<String> ids = ArrayList<String>();

What would be the cleanest way to make it Parceleable? Apparently String itself is not parcelable, so Parcel.writeList(ids) is not working.

I was thinking to either parcelize ArrayList<Uri> or put array contents into a Bundle.

Answer

cement picture cement · Oct 26, 2010

Convert your list to String[] and use Parcel.writeStringArray. Example here