Hello everybody, I am new to Kotlin and this chan...
# announcements
z
Hello everybody, I am new to Kotlin and this channel so I am not sure if it is the right place the post this: I am testing Kotlin Multiplatform. I want to create a function in androidMain with a argument which is an Activity. But it looks like kotlin does not recognise the type Activity.
fun foo(bar: Activity){}
Do I have to add anything in the build.gradle.kts? Thanks for your help.
d
#C0B8MA7FA #C3PQML5NU #C0B8M7BUY
I suggest you provide more context, maybe even show it in a git repo somehwere
z
Hello yes of course I am using a third-party library for video. A function needs the currentActivity to set the UI context. In Kotlin Multiplatform, I made the function below but I do not know how to access the type Activity.
fun setContext(currentActivity: Activity!){
connector.setUIContext(currentActivity) // this function request an Activity as parameter
}
l
Activity should be under the android library not the standard kotlin package perhaps?
Copy code
java.lang.Object
   ↳	android.content.Context
 	   ↳	android.content.ContextWrapper
 	 	   ↳	android.view.ContextThemeWrapper
 	 	 	   ↳	android.app.Activity