2014-04-16 10 views

답변

0

그래서, 트릭은 null listener을 제공하기 위해 리스너로 저장하고, 다음 버튼의 자신의 세트를 롤입니다 REFERENCE

DatePickerDialog picker = new DatePickerDialog(
     this, 
     null, // instead of a listener 
     2012, 6, 15); 
    picker.setCancelable(true); 
    picker.setCanceledOnTouchOutside(true); 
    picker.setButton(DialogInterface.BUTTON_POSITIVE, "OK", 
     new DialogInterface.OnClickListener() { 
      @Override 
      public void onClick(DialogInterface dialog, int which) { 
       Log.d("Picker", "Correct behavior!"); 
      } 
     }); 
    picker.setButton(DialogInterface.BUTTON_NEGATIVE, "Cancel", 
     new DialogInterface.OnClickListener() { 
      @Override 
      public void onClick(DialogInterface dialog, int which) { 
       Log.d("Picker", "Cancel!"); 
      } 
     }); 
picker.show();