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

Working with Plurals in Android

Ktor for Android development

Kotlin : Single Expression Function

Flutter — BLOC: fetch polylines from Firebase and display them on Mapbox map — Parte 2

Don’t get confused on delay & Thread.sleep() in Kotlin Coroutines

Creating Jetpack Compose Navigation and Submitting Arguments.

Upload files from Flutter Web to Firebase

Inner Balance HRV Sensor

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

Android 12 & Material You

Open camera and display image using kotlin

How to create material date and time pickers in android.

WearControl — A new way to play