开发者

Android : How to make a toast with counted checkbox?

Hai I'm trying to make a toast with counting of checkbox which are all checked. How can i do that? Thanks i开发者_如何学运维n advance.


you can show Toast like this:

Toast.makeText(getApplicationContext(), "Count " + countVariable, Toast.LENGTH_SHORT).show();


if you use listview with checkbox than use implement onItemClickListner and than use below code.

@Override
    public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
        // TODO Auto-generated method stub
        Log.e("arg2 "+String.valueOf((arg2)), "arg3"+String.valueOf(arg3));

    }

now take arrayList of Int and add all unique arg2 in this arrayList. and after your activity use this arrayList's methods.and put toast according your needs.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜