设置声音的通知 [英] Setting sound for notification

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

问题描述

如何设置声音为我的Andr​​oid应用程序的通知。在我的应用程序通知将在30秒后显示。我想给这个警报,例如静音模式,振动模式和选项从从设备可用音调来选择选项。我现在用的是preference屏幕显示设置菜单。我想设置通知铃声类型特殊应用。有什么办法来建立这个..

How can I set sound for notification for my android application. In my application notification will be shown after 30 seconds. I want to give options for this alerts such as silent mode, vibration mode and an option to select from the available tones from the device. I am using the preference screen to show the settings menu. I want to to set the notification ring type application specific. Is there any way to establish this..

推荐答案

<一个href=\"http://developer.android.com/reference/android/app/Notification.Builder.html#setSound(android.net.Uri\" rel=\"nofollow\">http://developer.android.com/reference/android/app/Notification.Builder.html#setSound(android.net.Uri)

Notification.Builder.setSound();

使用铃声preference在preference活动来获得所选择的声音的URI。

Use a ringtone preference in the preference activity to get the URI of the selected sound.

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

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