How do you prevent Android Wear activity from multiple instances?

Sometimes most of the time when my LG G Watch automatically closes the application by going into standby / smoothing mode, if I open the application again by going to the Start menu, two instances of activity will open (when I debug one from the previous one is at the bottom).

This never happens on the phone, does it work in Android Wear? Should I end () them in onPause ()?

Thanks.

+5
source share
1 answer

Have you looked at the android:launchMode in AndroidManifest.xml for activity?

maybe android:launchMode="singleInstance" will help you.

http://developer.android.com/guide/topics/manifest/activity-element.html#lmode

+3
source

Source: https://habr.com/ru/post/1200335/


All Articles