发生错误-MediaPlayer.OnClickListener无法解析为一种类型。
Uri video = Uri.parse(_video);
vd.setVideoURI(video);
vd.requestFocus ();
vd.setOnPreparedListener (new MediaPlayer.OnPreparedListener() { public void onPrepared (MediaPlayer mp) {
vd.start();
}
});
vd.setOnClickListener(new MediaPlayer.OnClickListener(){
@Override
public void onClick( MediaPlayer mp){
vd.stop(); } } );
尝试
vd.setOnClickListener(new View.OnClickListener(){//your code
})