我的 onPrepared(Mediaplayer mp) 方法中有一个方法 test()。test() 生成一个可运行文件并执行以下操作:
public void test() {
Runnable playerValues = new Runnable() {
@Override
public void run() {
System.out
.println("Player.testPlaying() --> Get Duration : "
+ vv.getDuration());
System.out
.println("Player.testPlaying() --> Total Bytes Read : "
+ Download.totalBytesRead);
System.out
.println("Player.testPlaying() --> Current Position : "
+ vv.getCurrentPosition());
handler.postDelayed(this, 1000);
}
};
handler.postDelayed(playerValues, 1000);
}
在播放器的 OnCompletion 方法中,我想停止这个 Runnable。我怎样才能做到这一点?