在Android应用程序播放声音报警错误 [英] error in playing a sound in alarm in android application

查看:144
本文介绍了在Android应用程序播放声音报警错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个Android应用程序中,我可以发挥报警,并设置reminder.I试图例子code present Android的样品中,其显示的通知 但不播放声音。如果有人已经实施了Android的报警请指导我。

I am developing an android application in which I have to play an alarm and set the reminder.I have tried the examples code present in android samples, Its showing notifications But not playing sound. If anyone has implemented alarm in android please guide me.

推荐答案

而Android AlarmManager 实际上并没有响起警报声。如果您安排一个报警的报警管理器将通过启动时设定的闹钟时间通知你的应用程序中的 PendingIntent 您所提供(你的情况AlarmService)。它没有做任何事情更多。如果你想要的声音,你的AlarmService应该发挥时启动服务。您可以使用android 媒体播放器这一点。

The Android AlarmManager doesn't actually ring an audible alarm. If you schedule an alarm the alarm manager will notify your app at the set alarm time by starting the PendingIntent you've provided (in your case the AlarmService). It doesn't do anything more. If you want sound, your AlarmService should play that when the service is started. You can use the android mediaplayer for this.

这篇关于在Android应用程序播放声音报警错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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