开发者

How to display timepicker dialog when radiobutton is clicked?

开发者 https://www.devze.com 2023-04-10 05:32 出处:网络
I\'m trying to display time picker dialog by using showDialog(1); when radio button is clicked. But i cannot display if i write onclick event for radio button. How to solv this开发者_运维技巧 problem?

I'm trying to display time picker dialog by using showDialog(1); when radio button is clicked. But i cannot display if i write onclick event for radio button. How to solv this开发者_运维技巧 problem? Any help is appreciated and thanks in advance...


  RadioButton r;
  r.setOnCheckedChangeListener(listener){

 @Override
 public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
 // add your dialog here
}

}


YOu follow the link to get to know about the date picker: http://www.androidpeople.com/android-datepicker-dialog-example

you just have to replace the button date to the radio button, note the id used in the button should be same as that in the radio button.

0

精彩评论

暂无评论...
验证码 换一张
取 消