Android Question [B4xPages] and IME event not called

udg

Expert
Licensed User
Longtime User
Hi all,
I tried everything I could think of.
I have an app using the B4xPages model. Originally it had the Activity attribute #FullScreen: True (I can't recall why I set that way) and, as expected the delegation of the HeightCanged event didn't work.

Now I changed the attribute back to False, Tools/Clean project (even manually deleted and rebuilt the Objects folder from a new empty project), but it still doesn't delegate.
Can you spot what I am missing?

All the code was copied and pasted from here

Manifest
B4X:
SetActivityAttribute(main, android:windowSoftInputMode, adjustResize|stateHidden)

Main
B4X:
Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: False
#End Region
..
Sub Globals
    Private ime As IME
End Sub

Sub Activity_Create(FirstTime As Boolean)
    ime.Initialize("IME")
    ime.AddHeightChangedEvent
    Dim pm As B4XPagesManager
    pm.Initialize(Activity)
End Sub

Sub IME_HeightChanged (NewHeight As Int, OldHeight As Int)
    Log("IMEEEEE")
    B4XPages.GetManager.RaiseEvent(B4XPages.GetManager.GetTopPage, "IME_HeightChanged", Array(NewHeight, OldHeight))
End Sub

B4xPage where I need the IME functionality
B4X:
'Handle keyboard changes:
Sub IME_HeightChanged (NewHeight As Int, OldHeight As Int)
    Log("IME - "&NewHeight&"  "&OldHeight)
End Sub

Run in debug mode, device attached by USB cable.
I can't see neither of the Logs related to the event.

Any idea? TIA
 

udg

Expert
Licensed User
Longtime User
No, that's the problem and why I opened this thread
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Here its is. Reduced at a bare minimum.
I suspect that the problem is in the Manifest or, eventually, in the interaction of a couple of elements.
 

Attachments

  • Project.zip
    78.7 KB · Views: 112
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Originally it had the Activity attribute #FullScreen: True (I can't recall why I set that way) and, as expected the delegation of the HeightCanged event didn't work.
B4X:
CreateResource(values, theme.xml,
<resources>
    <style
        name="DarkTheme" parent="@android:style/Theme.Material.Light.NoActionBar.Fullscreen">
          <item name="android:windowBackground">@color/window</item>
    </style>
</resources>
)
You are still using a full screen theme. You will need to switch to a non-fullscreen theme.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…