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/





Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

JavaScript Baby Steps

Benefits of Robotic Process Automation

Wrong Abstraction might slow down your team

Developing a new flutter app short tricks for beginners

First Post 🥳

My journey into the shoes of a coder|Learning update: Moment of enlightenment

Keeping Catalog Models Up-to-Date with Shopify Webhooks

A Behind the Scenes Look at The Different Fields Within the Software Development Industry

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
Suneet Agrawal

Suneet Agrawal


More from Medium

How to ask runtime camera permission after denied in android kotlin

Android camera permission

View binding tutorial with Kotlin


Android 12 & Material You

RecycleView pull to refresh using kotlin