Android Question IME problem

hookshy

Well-Known Member
Licensed User
Longtime User
I have problem with Ime lib .
If I use the statement from heightchanged event then the edit text lose focus and the keybord does not write nothing in the edit text !!
How can I find the problem ? It could be related to other ime.hidekeyboard events from the program but I can not find it ... I will reduce all code to see what happens ?
Any sugestions ?

B4X:
IME1.Initialize("IME1")
IME1.AddHeightChangedEvent
IME1_HeightChanged(100%y, 0)
IME1.AddHandleActionEvent(edit_notite)
'I want the edit_text to be placed on bottom and rise together with the keyboard 

Sub IME1_HeightChanged(NewHeight As Int, OldHeight As Int)
'is the statement below good ?
'    edit_notite.Top=NewHeight-edit_notite.Height
'    edit_notite.BringToFront
  
End Sub
 

hookshy

Well-Known Member
Licensed User
Longtime User
Another question related to ime :
the sub bellow does not seem to have something to do with edit_notite in particular ... because when I click on any other edit text in the program
then the toast message is showing ???
B4X:
Sub edit_notite_FocusChanged (HasFocus As Boolean)
    ToastMessageShow("has focus",True)
End Sub
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
??????????? I am having a bad day :(
B4X:
Sub edt_man_TextChanged (Old As String, new As String)
Log("edit text changed ************") 
    'do not understand why this code is executed while I am typing in another edit text - edit_notite ?????????
End Sub

all the problems seems to come from this statement

Sub IME1_HeightChanged(NewHeight As Int, OldHeight As Int)
' edit_notite.Top=NewHeight-edit_notite.Height
' edit_notite.BringToFront
end sub
 
Last edited:
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
Found problem !!!
by putting the statement bringtofront to edit text ...all IME library is upside down
every Sub name_TextChanged (Old AsString, new AsString) was executing and nothing worked ...

Sometime from my experience I remember that dealing with the IME inproperly forced the app to carsh instantly ...so be carefully with your code while dealing with edit text ...
We are causing the problems most of the time by mistakes ...but this is how we learn ...
Good luck to every one ! and do not complicate you lifes as I am used to :)

B4X:
Sub IME1_HeightChanged(NewHeight As Int, OldHeight As Int)
edit_notite.Top=NewHeight-edit_notite.Height
' edit_notite.BringToFront (bug)
end sub
 
Upvote 0
Top