Android Question Activity Key Press and Key Up

Yvon Steinthal

Active Member
Licensed User
Longtime User
Hello,

I am having quite a weird dilemma with the user input from a keyboard, especially with the ENTER key.
The idea for me is to always go through KeyPress and sometimes in KeyUp.

I found out that when i press enter the first time, the KeyPress event is triggered, i have a HttpJob following that event, and then the KeyPress event is no longer launched.

Here's my httpjob:

B4X:
If(isConnected And isOnline)Then
Dim getLists As HttpJob
getLists.Initialize("ListJob",Me)
getLists.Download("http://192.168.0.103/mobint/getvideolists.php")
End if

I don't see how the httpjob blocks my Activity_KeyPress (and only the enter key)...

Y.
 

Yvon Steinthal

Active Member
Licensed User
Longtime User
I am closing in on my bug, it seems that i manage spinners only using ENTER, UP, DOWN keys and loose focus using this code:

B4X:
     Dim r As Reflector
     r.Target =SpnPriority
     r.RunMethod2("setFocusable",False, "java.lang.boolean")
     r.RunMethod2("setFocusableInTouchMode", False, "java.lang.boolean")

And i set the same code to "True" whenever i need to change the value of the spinner (the user cannot physically touch the spinner and i needed to work around that)


EDIT: I removed the ability to focus on the spinner, and looped through the available choices using the LEFT and RIGHT arrows to solve my problem.
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…