开发者

Pop_up on checkbox selection

开发者 https://www.devze.com 2023-02-14 21:38 出处:网络
How can I display apop-up开发者_JAVA百科 immediately a checkbox is checked in Android?CheckBox yourCheckBox = (CheckBox) findViewById( R.id.yourCheckBox );

How can I display a pop-up开发者_JAVA百科 immediately a checkbox is checked in Android?


CheckBox yourCheckBox = (CheckBox) findViewById( R.id.yourCheckBox );
yourCheckBox.setOnCheckedChangeListener(new OnCheckedChangeListener()
{
   public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
   {
      if (isChecked)
         {
            //call popup
         }
   }
});

You just need to declare a call back for the CheckedChanged Event on the text box and then fire your method that displays the popup

0

精彩评论

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

关注公众号