开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜