Answer the question
In order to leave comments, you need to log in
How to run fragment fun from main activity?
I have a TabLayout, each tab has a fragment attached to it with its own markup.
Tell me how to run a function in a fragment from the main activity?
From the fragment, I launch the function of the main activity like this:
(activity as MainActivity).myFun()
Kotlin
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question