Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I have upgraded
targetSdkVersion
and
compileSdkVersion
to 33.
Now I am getting this warning
val picList =
result.data?.getParcelableArrayListExtra<PageNumberFile>(KEY_CAM_PIC_LIST)
It suggest me use Use the type-safer, What is the solution?
–
This method was deprecated in API Level 33
.
Use the type-safer getParcelableArrayListExtra(java.lang.String, java.lang.Class)
starting from Android Build.VERSION_CODES#TIRAMISU.
so you should use THIS getParcelableArrayListExtra(String name, Class<? extends T> clazz)
. Note second argument, in your case it should be PageNumberFile::class.java
PS. I would post working snippet/line, but you have posted code as image and I can't copy it for improving and pasting in my answer and I won't be rewritting this, too lazy. Don't ever post text as not-copyable image!
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.