2

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.

2 Answers 2

6

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

Sign up to request clarification or add additional context in comments.

1 Comment

3

This isnt parcelizing, but to put it in a bundle:

ArrayList<String> ids = new ArrayList<String>();
savedInstanceState.putStringArrayList("key",ids);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.