kisoft Well-Known Member Licensed User Longtime User May 6, 2019 #1 HI I would like to use this solution.. https://www.b4x.com/android/forum/t...native-to-autocompleteedittext.19379/#content How to get the index of the clicked item? I mean the index of items from a text file... Last edited: May 6, 2019
HI I would like to use this solution.. https://www.b4x.com/android/forum/t...native-to-autocompleteedittext.19379/#content How to get the index of the clicked item? I mean the index of items from a text file...
R ronell Well-Known Member Licensed User Longtime User May 6, 2019 #2 put the items in a list.. then you can find the index using this code B4X: Dim List1 As List List1 = File.ReadList(File.DirDefaultExternal, "items.txt") Sub SearchView1_ItemClick(Value As String) log(List1.IndexOf(Value)) End Sub Upvote 0
put the items in a list.. then you can find the index using this code B4X: Dim List1 As List List1 = File.ReadList(File.DirDefaultExternal, "items.txt") Sub SearchView1_ItemClick(Value As String) log(List1.IndexOf(Value)) End Sub
kisoft Well-Known Member Licensed User Longtime User May 6, 2019 #3 @ronel..Thank you very much for pointing out, now it works as it should. B4X: Sub SearchView1_ItemClick(Value As String) dim idx as int idx=cities.IndexOf(Value) end sub Last edited: May 6, 2019 Upvote 0
@ronel..Thank you very much for pointing out, now it works as it should. B4X: Sub SearchView1_ItemClick(Value As String) dim idx as int idx=cities.IndexOf(Value) end sub