开发者

android expandable list need help

开发者 https://www.devze.com 2023-03-10 02:56 出处:网络
expListAdapter = new ColorAdapter(this, GrouppList, colors); //setListAdapter(expListAdapter); exlv1=(ExpandableListView) findViewById(R.id.expandableListView1);
expListAdapter = new ColorAdapter(this, GrouppList, colors);
        //  setListAdapter(expListAdapter);
            exlv1=(ExpandableListView) findViewById(R.id.expandableListView1);
            this.exlv1.setAdapter(expListAdapter);
            //exlv1.setAdapter(expListAdapter);
            this.exlv1.setOnItemClickListener(new OnItemClickListener() {

                @Override //THIS NOT WORKING
                public void onItemClick(AdapterView<?> aview, View v,
                        int position, long id) {
                    Toast.makeText(FindFilesByType.this, "position "+position, Toast.LENGTH_LONG).show();
            开发者_如何学C        // TODO Auto-generated method stub

                }
            });
            this.exlv1.setOnChildClickListener(new OnChildClickListener() {

                @Override//THIS NOT WORKING
                public boolean onChildClick(ExpandableListView arg0, View arg1, int arg2,
                        int arg3, long arg4) {
                    // TODO Auto-generated method stub
                    Toast.makeText(FindFilesByType.this, "position 1 : "+arg3, Toast.LENGTH_LONG).show();
                    return false;
                }
            }); 
into the above code i wat to know which item has clicked from the list but i am not able to know that
i want to know its position i've used expandable list what is i am missing?
thaks in advance..


Hi Please check below link

http://about-android.blogspot.com/2010/04/steps-to-implement-expandablelistview.html

http://techdroid.kbeanie.com/2010/09/expandablelistview-on-android.html

0

精彩评论

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