Reputation: 4072
I have a service that does some extra work for android wear. I want to invoke the extra work only when the user is seeing my watch face.
One way to detect that the watch face is being invoked is by using the sendMessageAPI and a message will come.
How to know when the watchface has been changed?
Is message the only way to achieve this or there is some clean function given by the WearAPIs?
Thanks in Advance.
Upvotes: 0
Views: 175
Reputation: 42208
When the user chooses your watch face, the WatchFaceService.Engine subclass will receive onCreate
callback and when it is stopped being used, it will receive onDestroy
callback. Do the work between these two callbacks.
Upvotes: 1