• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How to pass mutableList through intent?

wseng92

Android Enthusiast
Oct 26, 2015
279
55
I have a mutableList which declared as below.

Java:
var newList: MutableList<String> = mutableListOf()

How to pass newList through intent?

I tried this but not working.

Java:
mIntent.putParcelableArrayListExtra("mFilePath", ArrayList(newList))

Error

Code:
 Type inference failed. Expected type mismatch:  required:
java.util.ArrayList<out Parcelable!>! found:
kotlin.collections.ArrayList<String!> /* =
java.util.ArrayList<String!> */
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones