views:

69

answers:

1

How do i on checkboxselected , show a toast that has data from database?

Thank you.

+1  A: 

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();
    }
});
Martin