Hi,
I was developing the library wrapper to use from b4a and faced a problem:
I need to set the content view for the activity from library java code, I know that I can use read-only xml layout and use it, but since most b4a-developers are using Designer tool and .bal-layouts I am wondering:
How the developer can add his custom .bal-layout to the activity if it's content view was set from the library?
My guess was somehow use a Panel, load custom layout to the panel and then add it to activity, something like this:
But I'm still getting "Should be initialized (Panel)" error. As I understood from documentation the views shouldn't be initialized if they're being loaded from layout.
Any help with that will be appreciated, thanks
I was developing the library wrapper to use from b4a and faced a problem:
I need to set the content view for the activity from library java code, I know that I can use read-only xml layout and use it, but since most b4a-developers are using Designer tool and .bal-layouts I am wondering:
How the developer can add his custom .bal-layout to the activity if it's content view was set from the library?
My guess was somehow use a Panel, load custom layout to the panel and then add it to activity, something like this:
B4X:
Sub Activity_Create(FirstTime As Boolean)
MyLibrary.init("xxxxxxxx") 'setContentView(id) is done there
Dim developersLayout As Panel
developersLayout .LoadLayout("Main")
Activity.AddView(developersLayout , 0, 0, 0, 0)
End Sub
But I'm still getting "Should be initialized (Panel)" error. As I understood from documentation the views shouldn't be initialized if they're being loaded from layout.
Any help with that will be appreciated, thanks