User358218
User358218

Reputation: 523

ListView with checkbox

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

Thank you.

Upvotes: 0

Views: 1117

Answers (1)

DonGru
DonGru

Reputation: 13710

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

Upvotes: 1

Related Questions