Android Question Create button on B4XMainPage

Duck

Member
Hi,

I like to create a bunch of buttons at runtime on the B4XMainPage as I understood B4Xpages is recommended.
I can declare and index them by the tag property:
<Code>
Private Btn(20) as Button
For i = 1 to 20
Btn(i).Initialize("Btn")
Btn(i).tag = i
Next
</Code>

But how do I make them visible?
Activity.AddView is not available on the B4XMainPage.
If I move all to the Main page and declare the buttons as Public they are not available on the B4XMainPage.

I appreciate your help.
 
Top