Skip to content Skip to sidebar Skip to footer

How To Correctly Register Data_changed Data Api Event After Crash/forcibly Stop?

I'm developing an Android app to collect data from an Android Wear. A WearableListenerService is used in the handheld device to receive data from the watch via Data API. But I noti

Solution 1:

It seems the listener won't be cleared after the app crash/stop.

Why should it? You've registered to that action through manifest and haven't unregistered from anywhere.

You can disable the component from onDataChanged() with PackageManager. setComponentEnabledSetting() API.

Set the enabled setting for a package component (activity, receiver, service, provider). This setting will override any enabled state which may have been set by the component in its manifest.

Post a Comment for "How To Correctly Register Data_changed Data Api Event After Crash/forcibly Stop?"