Typecast Android Object in Untiy

This post was originally posted at https://agrawalsuneet.github.io/blogs/typecast-android-object-in-unity/ and reposted on Medium on 5th June 2021.
//Java Code
Uri uri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
//Kotlin Code
val uri = intent.getParcelableExtra<Parcelable>(Intent.EXTRA_STREAM) as Uri
// or
val uri = intent.getParcelableExtra<Uri>(Intent.EXTRA_STREAM)

The answer is YES

Please continue reading at https://agrawalsuneet.github.io/blogs/typecast-android-object-in-unity/

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store