Search code examples
androidlistviewandroid-listfragmentfocusmanager

List focus on a particular item in that list dynamically


In my project i have a ListView for handling the list of a product. In that i have a list of 100 Items in that List view. Each and Every time i have been seeing the first row of the ListView..

If i need to see the data in the ListView Means, i need to scroll down, Can i focus directly to a particular item by any function by passing the position(ID) of the ListView..

For Example this is my ListView that contains 11 items in it..

I'm seeing every time the ListView as the following,..

And my try is, If i give the ListView position as ID=5 means, can i get the Focus of the ListView as follow, in the opening itself...

Can we get this by ListFragment method or anything else? Suggest me for the Best..


Solution

  • try this, use setselection

    listview.setSelection(position);