ListView with checkbox
How do i on ch开发者_JAVA百科eckboxselected , show a toast that has data from database?
Thank you.
Although the question is not quite specific this could help (assuming that your checkbox is called CheckBox01
and the statement Checkbox myCheckBox;
is somewhere above)
myCheckBox = (CheckBox) findViewById(R.id.CheckBox01);
myCheckBox.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (myCheckBox.isChecked()) Toast.makeText(getApplicationContext(), "Replace this with data from database string", Toast.LENGTH_LONG).show();
}
});
精彩评论