Exemplo n.º 1
0
    public void load() {
      if (this.mp != null) return;

      Log.d(TAG, "Context:" + context);

      this.mp = MediaPlayer.create(context, this.rid);
      Log.d(TAG, this.toString() + ": " + (mp != null ? mp.toString() : "null"));
    }
Exemplo n.º 2
0
 public void play() {
   if (this.mp != null) {
     Log.d(TAG, "Playing: " + mp.toString());
     if (this.mp.isPlaying()) this.mp.pause();
     this.mp.seekTo(0);
     this.mp.start();
   } else {
     Log.d(TAG, "Media not loaded: " + this.toString());
   }
 }