Android Question Android Layout size not loading properly

jtare

Active Member
Licensed User
Longtime User
Recently I experienced a really weird behavior when the activity load the layout.
Sometimes, randomly, the layout will load with very big text size and views, some views even appear half outside of the screen, making it impossible to use.

This issue happens when the app is opened after being a long time without use, a few hours or 1 day. Usually when opened from a notification. But in general is very random and almost never happens, most of the time it loads the layout perfectly.
The problem persist when starting a new activity.

The "solution" is to clear the app from the recent apps list and open it again.

Have someone experienced something similar? Here are some screenshots:
Normal behavior:

normal.jpg
Issue:
problem.jpg
 

jtare

Active Member
Licensed User
Longtime User
The code for the layout is in Designer -> Script-general, here I use mostly dip units and percentage to get screen width.
In Process_Globals I don't set any variable related with the layout design.
 
Upvote 0

jtare

Active Member
Licensed User
Longtime User
I thought about that too and added:
B4X:
    If FirstTime Then
        MsgboxAsync(GetDeviceLayoutValues,"Layout Values")
    end if
Under Activity_Create. But It shows the same value when the issue happens, 1080 x 1920, scale = 3.0 (480 dpi).

I will try it in Activity_Resume, it will take sometime until the issue happens again. I will reply here when I get the value.
 
Upvote 0

jtare

Active Member
Licensed User
Longtime User
What it reports when this issue happens?
Here are the results:
In Activity_Create: 1080 x 1920, scale = 3.0 (480 dpi) (DialogBox)
In Activity_Resume: 1080 x 1920, scale = 3.0 (480 dpi) (Activity title)
issue2.jpg
 
Upvote 0

jtare

Active Member
Licensed User
Longtime User
The issue have not showed up today, I will reply as soon as it shows up with the activity size values.
 
Upvote 0

jtare

Active Member
Licensed User
Longtime User
Update: The issue have not showed up yet, although it wouldn't be accurate saying that the issue is gone since no changes were made. If the issue shows up again I will post here with the layout values.
 
Upvote 0

jtare

Active Member
Licensed User
Longtime User
I think it's similar to my problem described here:
Thanks for the links. I will log the 1dip value to see if changes.
I'm also using a Samsung device, but I had never gotten this error in any other app tested in the same device.
What is causing this error could be samsung related?
 
Upvote 0

jtare

Active Member
Licensed User
Longtime User
Do you use AHViewPager(3.0) library in your app?
No I don't.
What I am using that I think could cause the issue because I never used them before are AHSwipeToRefresh, MPAndroidCharts and AS BottomMenu (class).
 
Upvote 0
Top