Android Question Searching through SearchView Custom View

Kiumbe

Member
Licensed User
Greetings Members,
I have downloaded the SearchView custom view module from HERE as provided by Erel, the example works perfect for filtering list items while typing on the edittext. I have copied the same module in my project and implemented the functions as below on one of my projects activity;

In Manifest Editor:
SetActivityAttribute(ServiceLines, android:windowSoftInputMode, adjustResize|stateHidden)
Declarations:
Sub Process_Globals
    Private index As Object
End Sub

Sub Globals
    Private SVLines As SearchView
    Private ime As IME
End Sub

Creating Activity:
Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("ServiceLines")
    If FirstTime Then
        Dim waterlines As List = File.ReadList(File.DirAssets, "MainLines.txt")
        index = SVLines.SetItems(waterlines)
    Else
        SVLines.SetIndex(index)
    End If
    ime.Initialize("ime")
    ime.AddHeightChangedEvent
End Sub

B4X:
Private Sub IME_HeightChanged (NewHeight As Int, OldHeight As Int)
    SVLines.ActivityHeightChanged(NewHeight)
End Sub

However when I try to search for any Service Line from the text file, the SearchView does not display anything, kindly help me out, am sure I may have missed something but I cant figure it out.

Thanks in advance
 
Solution
The codes you posted have no porblem, you'd better post a small project for help. I guess perhaps some properties of the SVLines are incorrect-maybe base background color is white.

teddybear

Well-Known Member
Licensed User
The codes you posted have no porblem, you'd better post a small project for help. I guess perhaps some properties of the SVLines are incorrect-maybe base background color is white.
 
Last edited:
Upvote 0
Solution

Kiumbe

Member
Licensed User
The codes you posted have no porblem, you'd better post a small project for help. I guess perhaps some properties of the SVLines are incorrect-maybe base background color is white.
Hello teddybear, imagine it is as you have noted, the text property was set to background color, nothing was showing up on the SvLines. How could such a tiny solution escape my attention??? Thanks a lot @teddybear . Your keen to details 👏👏👏👏
 
Upvote 0
Top