Android Question Although DONE button is pressed for EditText, cursor still blinks at the end of the text in EditText

Baris Karadeniz

Active Member
Licensed User
I have a EditText in my app. I click on EditText and write numbers and press on DONE button at the keyboard. Keyboard is closed but cursor is still blinking at the end of the text written in EditText. What can be the problem?
 

edm68

Member
Licensed User
Longtime User
I'm not sure if this is the proper way but this seems to work for me.
I add another edittext, set it's height and width to 1, place it out of the way. I call it something like edtNull. Then in your enter event for your textbox at the end add "edtNull.RequestFocus" and it should remove the cursor.
 
Upvote 0

Baris Karadeniz

Active Member
Licensed User
But I used TextView for iOS and everything was ok. Why I need to do something more in android? It should exit from the text when the DONE button is pressed. May be I didn't do button settings as should be. Is there any idea or solution?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Set the focus to another ui element to stop the cursor blinking

B4X:
btn.RequestFocus
 
Upvote 0

Baris Karadeniz

Active Member
Licensed User
I did as you said but problem still occurs. May be I wrote to the wrong place?

B4X:
Sub TextFieldimei_EnterPressed
    If Not(IsNumber(TextFieldimei.Text)) Or TextFieldimei.Text.Length <> 15 Then
        Msgbox(warning2, warningtitle1)
        TextFieldimei.Text = ""
        Else
        File.WriteMap(File.DirInternal,"user",CreateMap("userimei":TextFieldimei.Text))
    End If
    BtnStatusBack.RequestFocus
End Sub
 
Upvote 0
Top