Android Question EditText search

Jose Luis Barajas

Member
Licensed User
Longtime User
Hello

I have a sub that search data from sqlite, using EditText view,
when the user add text (character by character) my sub call this function.
This solution does not run very well on many devices (poor cpu, for example)

How I can create a delay in EditText change event, I do not want add a button for make search.

My sub its as follow:

Sub EditTextSearch_TextChanged (Old As String, New As String)

CustomListViewDocuments.Clear
If EditTextSearch.Text.Trim <> "" Then
CargaDocumentosDb(EditTextSearch.Text.Trim)
Else
CargaDocumentosDb("")
End If

End Sub


Thanks in advance!
 

somed3v3loper

Well-Known Member
Licensed User
Longtime User
Perhaps you might want to search database in a thread (Threading library) and in thread_Ended check if it was successful and then call a sub to update your UI .
 
Upvote 0
Top