I have an activity class and need for it to obtain the current interruption filter setting (which can be obtained from NotificationListenerService's getCurrentInterruptionFilter() method).
But in order to use NotificationListernService I must derive my own class from it first.
So if I have MyActivity class and MyNotificationListenerService class, how should the MyActivity class access the MyNotificationListenerService class?
AFAIK I do not explicitly create nor start the MyNotificationListenerService class as the OS will create/bind it automatically? So as the listener class will be created automatically, how can MyActivity access it?
I could override the listener's onInterruptionFilterChanged() method and send a broadcast to MyActivity. But I do not need to monitor for changes to the interruption filter, I just need to call getCurrentInterruptionFilter() once at app start up and that is all.
0 comments:
Post a Comment