Android Question Move to a Row in ListView

Discussion in 'Android Questions' started by GeoffT660, Feb 5, 2015.

  1. GeoffT660

    GeoffT660 Active Member Licensed User

    I'm trying to read a value and find that value in a ListView and move to that row in the list view. I can see the JumpToRow function but what is the best way to search a value in a column and return the row number to Jump to.
     
  2. KMatle

    KMatle Expert Licensed User

    Create a list, too:

    Code:
    Dim MyList as list
    When you add a line to the listview, add it to the list, too.

    Later you can search in it with

    Code:
    i=MyList.IndexOf("SomeText")
    and get the index ("line") of the found text which is equal to the listview's row index.

    If not found you'll get a -1

    With it you can use that code snippet to scroll to the wanted position (like x'th row * row height)
     
  3. GeoffT660

    GeoffT660 Active Member Licensed User

    Thanks for your help. I was able to create a list by looping through the SQLLite Table with the same SQL Select statement as in the LoadSqlLiteDB Call and it worked as your suggested. What if I'm using LoadSqlLiteDB to fill the table and there could be searching on different fields (columns) but only one field at a time. Are there any other methods to accomplish the same thing?
     
  4. DonManfred

    DonManfred Expert Licensed User

    start a new thread for this question describing what you want to archieve and whatcode you are using. Without seeing what you have done and how it is hard to give advices. But this question is more related to sqlite than the topic here (therefore new thread)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice