Android Question SearchView For SQL?

ronovar

Active Member
Licensed User
Longtime User
I have apk that uses SQL database that is saved on android debice (database.db), and it uses to filter items by buttons (order by title, year....).

I would like to add searchView when user press RED button to show SearchView....and when user is typing letters it refresh listview with items that sql is found,

How is this possible with SearchView and SQL?

To be simple question: how can i use SearchView input to search SQL database on device and then refresh listview that is holding items from database correcsponding to SearchView input?
 

DonManfred

Expert
Licensed User
Longtime User
Use a edttext and a button (or textchanged event)
Do a database search when pressing the button and display the results in a listview.
There is no Searchview for sql in b4a...

You need to build the functionality by yourself.
 
Upvote 0

ronovar

Active Member
Licensed User
Longtime User
Ok thanks..i got the idea...just more one question... can i use inputdialog (this is android dialog that i use for pin input) and when keyup is pressed in inputdialog to fire up sub that takes input string from inputdialog and then do sql query and clear and show items in listview...i think about this inputdialog:

B4X:
'SET - Type
    InputDialog1.InputType = InputDialog1.INPUT_TYPE_PHONE           
    'SETTINGS - InputDialog
    InputDialog1.Input = ""
    InputDialog1.HintColor = Colors.ARGB(196, 255, 140, 0)
    ParentReturn = DialogResponse.POSITIVE
   
    'SHOW - InputDialog1
    ParentReturn = InputDialog1.Show(CRLF&"Search:", "SearchBOX", "OK", "Cancel", "", LoadBitmapSample(File.DirAssets, "logo.png", 36, 36))
 
Upvote 0

ronovar

Active Member
Licensed User
Longtime User
Ok i successfully show edittext using visible = True but i need to press button OK on remote control to show softkeyboard...how can i do this automatically when i put EditText.Visible=True and EditText.RequestFocus to show automatically softkeyboard?
 
Upvote 0

ronovar

Active Member
Licensed User
Longtime User
Great it now shows softkeyboard when i show edittext but when softkeyboard is show and i press on remote control back key it hides softkeyboard (which is what i need) and edittext is show, so i need to press one more time back button on remote control to hide edittext. How can i automatically hide edittext when softkeyboard is hiden when user press back key?
 
Upvote 0

ronovar

Active Member
Licensed User
Longtime User
Can you please write here example of event? I could not hide edittext when softkeyboard is hidden..so i nee to press one more tme back button on remote control to hide edittext...i use IME to show softkeyboard and softkeyboard is automatically focused...on press back key i im focused back to textedit and textedit is not hidden.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top