问题
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