Android Question Hide password during input (textbox)

jo1234

Active Member
Licensed User
Longtime User
Hi,

I have a textbox that is used to enter the password. I have set the "password" property of the textbox to TRUE and selected the InputType = 524288 (TYPE_TEXT_FLAG_NO_SUGGESTIONS) to suppress text suggestions.

The text in the textbox is shown as dots when the focus is somewhere else. That's ok.
However, when you click on the textbox the keyboard opens and the password is shown as plain text.

How can I show the text as dots when the keyboard is open?

thanks a lot,
John
 
Code:
EditText1.InputType = Bit.Or(EditText1.InputType, 0x00000080) ' Dont use autocompletion on password...

Have you set the edittext to Password = true in designer?
snap0054.png
 
Last edited:
Upvote 0
Yes, I have set the password property to True.
The problem is when I enter text. The text above the keyboard is shown as plain text. When I leave the keyboard, the text is shown as dots in the EditText control. However, when I edit the text again, then the password is again shown as plain text above the keyboard.

The Masked EditText library would be an option, but I'm still hoping that it could be done with the standard EditText control.

Any idea how I can prevent the EditText control from revealing the password when the keyboard is on?
thanks!
 
Upvote 0
Upvote 0
Any idea how I can prevent the EditText control from revealing the password when the keyboard is on?
Make the box color the same as the box text color
Code:
Sub  txttest2_FocusChanged (HasFocus As Boolean)
    txtTest2.InputType = Bit.OR(txtTest2.InputType, 0x00000080)  'remove suggestion
    If HasFocus Then 
     txtTest2.Color=txtTest2.TextColor   'masks input
    Else
        txtTest2.Color=Colors.White    'or whatever color
    End If
End Sub
 
Upvote 0
Back
Top