Android Question Remove focused on items from customlistview

nedium

Active Member
Licensed User
Longtime User
Hello everyone, and thank you for any help you can give me.


I am creating an application that will be used on both touch devices and TV boxes (firetv, etc.), I am removing focus from all the objects that are visible using this code.

QuitarFocused:
Sub QuitarFocused (UV As View)
    Try
    Dim joS As JavaObject = UV
    joS.RunMethod("setFocusable", Array(False))
    joS.RunMethod("setFocusableInTouchMode", Array(False))

    Catch
        Log(LastException)
    End Try
End Sub


but in my application I am using 2 customlistviews that add the items from a 'LoadLayout', and I also remove the focus with the above code.


example:
Dim pan As B4XView = xui.CreatePanel("")
pan.SetLayoutAnimated(0, 0, 0, 96%x, 30%y)
pan.LoadLayout("Lista")
QuitarFocused(pan)
Return pan

The application on touch devices works correctly, but when I use a TV box or a Bluetooth remote control, it takes focus from the items added to the list and I don't want it to take focus.

Is there any possibility of being able to remove all the fucus from all the objects, or a way to find the object that has active focus?

note: I am not using the EditText view, it only happens with the items added to the list, and executing the accept button only clicks on those objects.

Thank you very much for the help. I hope to find a solution
 
Top