how to play sound in specific times?

限于喜欢 提交于 2019-12-13 09:22:32

问题


hi i had android app which play sound when value on i did my code well and it worked well . I need to make as list or array or whatever have specific days with times as :

day 07.07.1013

times 3.30pm , 1.20am ,3.30am ....etc.

as when the day 07.07.2013 and the o'clock 1.20am the sound play . how to do that ?

 @JavascriptInterface
public void playsound(String value  ) {

    if (value.equals("on")){
        checked = true;

        mp.setLooping(true);
        mp.start();
    }
    else 
    {  
        checked = false;
        mp.stop();
    }
}

回答1:


Use AlarmManager to set an alarm for that time. When the alarm comes in, play the sound.



来源:https://stackoverflow.com/questions/17502862/how-to-play-sound-in-specific-times

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