B4A v2.30 beta - loadlayout problem

wl

Well-Known Member
Licensed User
Longtime User
Hello,

It seems 2.30 beta has a problem loading a layout on a panel. It generates a Java exception that the layout could not be loaded.

Dim p As Panel
p.Initialize("panel")
p.LoadLayout("filterpanel")

I reverted back to v2.25 and there it works (again).

Wim
 
Erel,

As I uninstalled the B4A 2.3 beta and other info could be relevant: I will send the project including the few steps to take to reproduce the problem to support ?

Wim
 
Upvote 0
Besides the errors related to loading a layout into a panel (which I know now is related to undeclared panel's size and fixable) I have a problem loading correct layout variants (and it's the same in 2.2). To be short, if I don't have a specific variant for the device I'm testing, the app will always pick the smallest variant I have in the layout file, like 320x480.
I don't know, may be it's by design; I searched the tutorials and posts but couldn't find any info on how b4a picks the layout variant if it cannot find a matching set.
Example: I have the following variants: 800x1280/1280x800, 600x1024/1024x600, 320x480/480x320 all in one layout file. When device's screen is exact match, it's fine, it picks the right layout variant. But if I load the app on 1440x900 screen, it picks 480x320 layout, though logically the best match would be 1280x800. Same thing about let's say 1280x720 (i use this size on my hardware accelerated VM simulator to capture apps' promo videos at 720p) - it picks 480x320 instead of much closer 1024x600 variant.
 
Upvote 0
Erel,


Just to let you know: while awaiting your fix I reinstalled 2.30 beta ans siwtched the order of the code (first adding the panel before loading the layout).

This worked, but in this way the rightmost control in my panel was not shown.

Just to let you know...
 
Upvote 0
Erel, Just to let you know: while awaiting your fix I reinstalled 2.30 beta ans siwtched the order of the code

I did the same yesterday, worked for me too, no other problems so far.
 
Upvote 0
Same here - I just did the following and it worked again

I had the same problem, I switched this following from

If PnlLayouts.IsInitialized Then
Activity.RemoveViewAt(0)
End If

PnlLayouts.Initialize("")
PnlLayouts.LoadLayout(Layout)
Activity.AddView(PnlLayouts, 0, 0, 100%x, 100%y)

to

If PnlLayouts.IsInitialized Then
Activity.RemoveViewAt(0)
End If

PnlLayouts.Initialize("")
Activity.AddView(PnlLayouts, 0, 0, 100%x, 100%y)
PnlLayouts.LoadLayout(Layout)

and it started working :D
 
Upvote 0
Erel My CustomTabHost now doesn't work because of this.

How do I get around this problem?

Do I have to rewrite all my internal code for the class?

regards, Ricky

***** Disregard - I am using the AddTab feature of the class to get around this issue
 
Last edited:
Upvote 0
Erel,

I got an email with a link to the 2.30 download a week (or 2) ago.

Is this the beta or the fixed version?
 
Upvote 0
Panel.LoadLayout error in v2.30

Hello,

I still have this problem in v2.30...

Here is a code where I am getting this:

svcClient.Initialize(100%y)
svcClient.Panel.LoadLayout("frmClientDetails")

Any ideas what to do here?

Thanks,
Elad.
 
Upvote 0
Yes, I am sure - I checked it again...

Can you please guide me how can I post the stack trace from the logs?

Thanks,
Elad.
 
Upvote 0
Back
Top