android - How to play a custom sound after the countdown timer ends? -


i trying implement following functionality in application

  1. the user selects music file in 1 input field , time duration ( seconds ) in other.
  2. 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

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -