I am trying some thing new on Android for which I need to access the handler of the UI thread.
I know the following:
In kotlin thats how you can do it
kotlin
Let say if you want to show Toast message from service
val handler = Handler(Looper.getMainLooper()) handler.post { Toast.makeText(context, "This is my message",Toast.LENGTH_LONG).show() }