Example #1
0
 /** Runs the thread. */
 public void run() {
   try {
     music.play();
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
Example #2
0
 /** Returns the song time. */
 public String getTime() {
   int position = music.getPosition();
   position /= 1000;
   int seconds = position / 60;
   int minutes = position / 60 / 60;
   String time = minutes + ":" + seconds;
   return time;
 }
Example #3
0
 /** Returns whether or not music is finished. */
 public boolean isComplete() {
   return music.isComplete();
 }
Example #4
0
 /** Stops the song. You cannot restart it afterwards. */
 public void stopSong() {
   music.close();
 }