Pop_up on checkbox selection
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
精彩评论