Android Question B4X Pages bug?

ilan

Expert
Licensed User
Longtime User
Hi

this is related to this thread:


and now i also understood when it happens and i can recreate it. so what happens is when you perform a search from the home screen and you load the keyboard and search for an app if you open the app right from there it will open in HALF SCREEN mode. if you open the app regular from the main screen it opens normal full screen only if you do it when the android keyboard is open i guess. THIS happens ONLY with B4xPages apps if i try it with app that are not b4xpages they work just fine.

see video:


if you want to try it by yourself just create a simple b4xpages app and close all apps in the background then open it from the home screen search menu with keyboard open.

how can we fix it?

(tried on my galaxy ultra s25)
 

LucasHeer

Active Member
Licensed User
Longtime User
Hi

this is related to this thread:


and now i also understood when it happens and i can recreate it. so what happens is when you perform a search from the home screen and you load the keyboard and search for an app if you open the app right from there it will open in HALF SCREEN mode. if you open the app regular from the main screen it opens normal full screen only if you do it when the android keyboard is open i guess. THIS happens ONLY with B4xPages apps if i try it with app that are not b4xpages they work just fine.

see video:


if you want to try it by yourself just create a simple b4xpages app and close all apps in the background then open it from the home screen search menu with keyboard open.

how can we fix it?

(tried on my galaxy ultra s25)

Hey! I had this issue with a few of my apps, I found a simple workaround.

Get rid of keyboard resize in manifest, then set it back at activity start/resume:

I had to change:
B4X:
SetActivityAttribute(main, android:windowSoftInputMode, "adjustResize|stateAlwaysHidden")

To:
B4X:
SetActivityAttribute(Main, android:windowSoftInputMode, "stateAlwaysHidden|adjustNothing")


Then on your Main Activity, you can switch back:
B4X:
Sub Activity_Resume
    Log("Main::Activity_Resume")
    
    Dim in As Intent
    in = Activity.GetStartingIntent
    If in.HasExtra("Notification_Tag") Then
        Globals.show_message(in.GetExtra("Notification_Tag"))
    End If
    Dim clearNot As Notification
    clearNot.Initialize
    clearNot.Cancel(1)
    B4XPages.Delegate.Activity_Resume
    AppOpen=True
    
    SetSoftInputModeResize
End Sub

Private Sub SetSoftInputModeResize
    Try
        Dim act As JavaObject
        act.InitializeContext
        Dim win As JavaObject = act.RunMethod("getWindow", Null)
        win.RunMethod("setSoftInputMode", Array(Bit.Or(3, 16))) 'STATE_ALWAYS_HIDDEN | ADJUST_RESIZE
    Catch
        Log(LastException)
    End Try
End Sub
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
but the keyboard that is shown is from outside the app when you perform a search in the home screen you type the name and an icon appear then when you click it to open the app the b4xpages app opens half size. if it is NOT a b4xpages app like b4a app without using b4xpages it works just fine. it has something to do with the b4xpages library how it handles the resizing of the activity i guess.
 
Upvote 0

LucasHeer

Active Member
Licensed User
Longtime User
but the keyboard that is shown is from outside the app when you perform a search in the home screen you type the name and an icon appear then when you click it to open the app the b4xpages app opens half size. if it is NOT a b4xpages app like b4a app without using b4xpages it works just fine. it has something to do with the b4xpages library how it handles the resizing of the activity i guess.
Yes sir, I've traced this problem through b4xpages. There is a keyboard height event called on app start (closing keyboard), but the root B4Xview is created with incorrect size.

However, that workaround definitely works without needing to recode anything 👍

I use B4XPages and had the same issue– I use this method to fix the half height on launch (when keyboard was present before launch.)
 
Upvote 0
Top