I want to get the index of the selected item (click) in a ListView.
Can anyone tell me?
Thanks Deepak
You need to use AdapterViewits onItemClick method too:
AdapterView
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView<?> list, View v, int pos, long id) { yourAdapter.getItem(pos); } });
Looks like you can get this with ListView1.FocusedItem.Index these days ...
Source: https://habr.com/ru/post/1757996/More articles:how to show thumbnails of youtube video - phpConvert C # classes (class library) to SQL DDL (tables) - c #Constructor inheritance problem - delphiis couchdb good for this occasion? - couchdbUsing a basic jQuery selector and unique element identifier - jqueryUsing app.config in MBunit test - c #regex int or float - phpFacebook apps and animated Gif downloads - javascriptJavascript function containing jQuery ajax - Function returns undefined - functionIdentification of registry and file system changes - c ++All Articles