Insistent notification on Android Wear

心不动则不痛 提交于 2019-12-12 06:00:07

问题


Notification.FLAG_INSISTENT works on my Android device. Notification vibrates and sounds repeatedly. However it only vibrates once on my Android Wear.

I have followed the Android Developer guide to create an Android Wear notification, but no luck. https://developer.android.com/training/wearables/notifications/creating.html

I want the effect of the stock Android Alarm Clock app's notification.

Any hint before I dig into the source code of the app?


回答1:


You need to add an Android Wear app to your existing project. Vibrate the watch with the Vibrator class there. Note: The package names of both the handheld device app and Wear app must be the same.

Reference: http://dejan.djurovski.net/2014/10/02/adding-an-android-wear-component-to-an-existing-android-studio-project/



来源:https://stackoverflow.com/questions/33001906/insistent-notification-on-android-wear

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!