示例#1
0
 /** Runs the thread. */
 public void run() {
   try {
     music.play();
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
示例#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;
 }
示例#3
0
 /** Returns whether or not music is finished. */
 public boolean isComplete() {
   return music.isComplete();
 }
示例#4
0
 /** Stops the song. You cannot restart it afterwards. */
 public void stopSong() {
   music.close();
 }