Android Wear 上的持续通知 [英] Insistent notification on Android Wear

查看:45
本文介绍了Android Wear 上的持续通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Notification.FLAG_INSISTENT 适用于我的 Android 设备.通知反复振动和响起.但是,它在我的 Android Wear 上只振动一次.

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

我已按照 Android 开发人员指南创建了 Android Wear 通知,但没有成功.https://developer.android.com/training/wearables/notifications/creating.html

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

我想要股票 Android 闹钟应用程序通知的效果.

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

在我深入研究应用源代码之前的任何提示?

推荐答案

您需要将 Android Wear 应用添加到现有项目中.使用 Vibrator 类振动手表.注意:手持设备应用和Wear应用的包名必须相同.

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.

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

这篇关于Android Wear 上的持续通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆