android - How to play a custom sound after the countdown timer ends? -
i trying implement following functionality in application
- the user selects music file in 1 input field , time duration ( seconds ) in other.
- after user presses ok, count down timer starts , runs till entered time duration expires , chosen music file should start playing.
can please advise me on best way implementing other using alarm manager?
final timer timer = new timer(); final timertask task = new timertask() { @override public void run() { mediaplayer mp = new mediaplayer(); mp.setdatasource(path_to_file); mp.prepare(); mp.start(); } }; timer.schedule(task, delay);
Comments
Post a Comment