Layout problem in 2.2beta

Ricky D

Well-Known Member
Licensed User
Longtime User
If I place an EditText onto a layout then in code request focus to it the Input Type, which is NUMBERS is totally ignored and the alpha keyboard is being shown.

Has anyone encountered this?

regards, Ricky
 

Ricky D

Well-Known Member
Licensed User
Longtime User
Ok I solved my little dilemma.....

B4X:
Sub etMorning_FocusChanged (HasFocus As Boolean)
   If HasFocus Then 
      etMorning.SelectAll
      IME.SetCustomFilter(etMorning, etMorning.INPUT_TYPE_NUMBERS, "0123456789")
      IME.ShowKeyboard(etMorning)
   End If
End Sub

now when I do this

B4X:
etMorning.RequestFocus

from a button press I get the desired effect. Just setting the view's Input Type in the designer doesn't work and this is my workaround.

regards, Ricky

P.S It's good I have some time on my hands now lol
 
Upvote 0

smartdispatch

Member
Licensed User
Longtime User
We are experiencing a similar issue with the new 2.20 b4a as well.

Before we were able to select type as none. But now no matter what we do the native android keyboard and focus now appears.

We cannot have this happen in our production applications for our corporate clients.

Do you have any ETA on a fix or a temporary solution?
 
Upvote 0

Ricky D

Well-Known Member
Licensed User
Longtime User
Until there is a fix I'd try this to negate the keyboard when focus is received for views with no input :

B4X:
Sub etMorning_FocusChanged (HasFocus As Boolean)    
    If HasFocus Then   
        IME.HideKeyboard     
    End If
End Sub

where IME is defined in Sub Globals as IME and I just initialize like

B4X:
Dim IME As IME
.
.
IME.Initialize("")

then you use this IME all through the activity and edit texts or even autocompleteedittexts you have. See how that works.

regards, Ricky
 
Upvote 0

Ricky D

Well-Known Member
Licensed User
Longtime User
Hi Erel.

So have many people encountered this with v2.2?

I got your email, downloaded the full version and it still does this.

regards, Ricky
 
Upvote 0

Ricky D

Well-Known Member
Licensed User
Longtime User
It works in code but not if you set them in the designer and don't explicitly code for them. I'm doing the setting in Activity_Create.

It's working for me but I never used to have to do this under previous versions.

regards, Ricky
 
Upvote 0
Top