0

Media Player でこの関数を使用して警告ダイアログを生成し、ユーザーがビデオを再開したときに応答しました

  setPositiveButton-->"Start Over"
  setNegitiveButton-->"Resume"   

        public abstract void onClick (DialogInterface dialog, int which){
          //what i need is disable the "RESUME" if user clicked it once...

ここに関数全体を貼り付けます 変更してください...

   private void showResumeDialog(Context context, final int bookmark) {
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setTitle(R.string.resume_playing_title);
    builder.setMessage(String.format(
            context.getString(R.string.resume_playing_message),
            GalleryUtils.formatDuration(context, bookmark / 1000)));
    builder.setOnCancelListener(new OnCancelListener() {
        @Override
        public void onCancel(DialogInterface dialog) {
            onCompletion();
        }
    });
    builder.setPositiveButton(
            R.string.resume_playing_resume, new OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            mVideoView.seekTo(bookmark);
            startVideo();
        }
    });
    builder.setNegativeButton(
            R.string.resume_playing_restart, new OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            startVideo();
        }
    });
    builder.show();
}
4

1 に答える 1