I have a problem which occurs only when I use AnySoftKeyboard.
I’m trying to show/hide the keyboard according to EditText focus.
I used the methods I found in this post
When I’m hiding the keyboard, there is a strange behavior –
- When I rotate the screen, the text that was in the EditText is doubled.
- I thought that it has to do with the onCreate method, but I can see the it happens also when I click “back” (Finish()). I see it for a split second before the Activity is closed.
- When I start a new activity, (ActivityB from ActivityA) then clicking “Back” once doesn’t do anything (probably “closing” the invisible keyboard).
- When I click “back” again, ActivityB closes but I can see for a split second the text from ActivityA keyboard in a big font across the screen (like a 100 millisecond pop-up )
Does anyone has an idea how to deal with it?
Apparently it is a bug in AnySoftKeyboard.
I didn’t happen when I use other keyboards.
I solved it by doing setText to the EditText view before hiding it – its probably resets some stuff on keyboard object.
Here is my code:
Surprisingly it works!