Nirav Bhandari
Nirav Bhandari

Reputation: 4610

Itemclick event in listview with section

i m developing application in which my activity contain listview with section...

when i click on listview it gives me position on listview but i want to know position of item within particular section..

i suppose to know the name of the header as well as positiion of item on click event...

can any one suggest me what to do???

Upvotes: 0

Views: 474

Answers (1)

mudit
mudit

Reputation: 25534

Try using onItemClickListener instead of OnCLickLisnter. For example:

ListView listView = new ListView(this);
        listView.setOnItemClickListener(new OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> arg0, View v, int position,
                    long arg3) {
                // do whatever you want
            }

        });

Upvotes: 1

Related Questions