Is there a way that I can detect the active activity from my BroadcastReceiver
?
Here's my code:
class Receiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
// check the active activity
// if MainActivity then ....
// if OtherActivity then ...
}
}