Android Question IME_HeightChanged never gets called (edittext on tabstip) - Solved

tsteward

Well-Known Member
Licensed User
Longtime User
I have an edittext on a panel in a tabstrip.
I click on the edittext and the keyboard opens but the IME_HeightChanged never gets called

Anything special I need to know when using tabstrip etc?
 

tsteward

Well-Known Member
Licensed User
Longtime User
What code do you have in this sub:
Sub IME_HeightChanged(NewHeight As Int,OldHeight As Int)
At this stage I only have the following line of code but when run in debug mode I put a break point on that line and it never goes in there.
B4X:
Sub IME_HeightChanged(NewHeight As Int, OldHeight As Int)
    feedbackText.Top = NewHeight - feedbackText.Height
    
End Sub
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
At this stage I only have the following line of code
Since the feedbackText edittext is a child of the panel, did you try this and still have issues.
B4X:
Sub IME_HeightChanged(NewHeight As Int, OldHeight As Int)
    feedbackPanel.Top = NewHeight - feedbackPanel.Height   
End Sub
 
Last edited:
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
Since the feedbackText edittext is a child of the panel, did you try this and still have issues.
B4X:
Sub IME_HeightChanged(NewHeight As Int, OldHeight As Int)
    feedbackPanel.Top = NewHeight - feedbackPanel.Height  
End Sub
Made no difference :(
Does manifest line to to be set for each activity?
at the moment I have
SetActivityAttribute(main, android:windowSoftInputMode, adjustResize|stateHidden)

But this is in a different activity. Should there be multiple entries for multiple activities?
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
But this is in a different activity. Should there be multiple entries for multiple activities?
According to the below link:, Erel writes:
Update: You should explicitly set the adjustSize mode with the manifest editor. This is done by adding the following manifest editor code (for each activity):
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
I have added to manifest but still IME_HeightChanged event never gets called.
Tried vehicleonly all lower case and didn't help


B4X:
SetActivityAttribute(main, android:windowSoftInputMode, adjustResize|stateHidden)
SetActivityAttribute(VehicleOnly, android:windowSoftInputMode, adjustResize|stateHidden)
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Project with TabStrip + IME + B4XPages is attached. Works fine.
Erel, Are you sure you are not missing this line from the main activity in your posted project:
B4X:
B4XPages.GetManager.RaiseEvent(B4XPages.GetManager.GetTopPage, "IME_HeightChanged", Array(NewHeight, OldHeight))
I am using B4A 10.2 unless you changed it in 10.5
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I have added to manifest but still IME_HeightChanged event never gets called.
Tried vehicleonly all lower case and didn't help
So what is the verdict with your issue. I tested Erel's project using B4XPages and it works. I created a similar project without the B4XPages method and it works. Can you please tell us if you solved it or not. When you receive help in the forum, you need to reciprocate by outlining your solution or accept the proposed solutions.
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
So what is the verdict with your issue. I tested Erel's project using B4XPages and it works. I created a similar project without the B4XPages method and it works. Can you please tell us if you solved it or not. When you receive help in the forum, you need to reciprocate by outlining your solution or accept the proposed solutions.
Sorry if i'm not going fast enough for you but I have a job as well.
No I have not solved the problem. It works in my main activity but still can't get it to work in sub activity. Hopefully I'll get time to work on it today.
Thank you both for your help
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
Okay I have no idea how to find my problem. Can I send my rather large and poorly written app to one of you two gentlemen privately so you can hopefully see the problem?
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Okay I have no idea how to find my problem
I would rather not deal with private data, but I created a simple project for you that raises and lifts the edittext views and button above the keyboard when the focus shifts to the edittext(s) They are on a tabstripviewpager on the second activity other than main. I have tested it thoroughly on two devices and it works for me. I hope you can check it out and hope it sheds some light on your project.
 

Attachments

  • IMEtabstripViewPager.zip
    14.3 KB · Views: 177
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
Thank you I will look at it tomorrow. Otherwise I will knock up a sample with my poor coding practices (B4A allows hacks like me to write programs :) ) and see what happens.
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
I would rather not deal with private data, but I created a simple project for you that raises and lifts the edittext views and button above the keyboard when the focus shifts to the edittext(s) They are on a tabstripviewpager on the second activity other than main. I have tested it thoroughly on two devices and it works for me. I hope you can check it out and hope it sheds some light on your project.
I have played with your example and added stuff to it etc all works perfectly.

In my app the Sub IME_HeightChanged just never fires.
So I figured something is interfering with it, and I went through my manifest file again and found I had this down lower
SetActivityAttribute(vehicleonly, android:windowSoftInputMode, adjustResize|stateHidden)
SetActivityAttribute(vehicleonly, android:windowSoftInputMode, "stateHidden|adjustPan")

I don't know why.....
Anyway removed the second entry and now IME_HeightChanged fires and I'm all smiles again :)

Thank you for all your effort - Mark this mystery as solved.
 
Upvote 0
Top