Android Question Handling views - where should the code go?

JeffT

Member
Licensed User
I had a prototype working where I had one Activity and the code for that was in a class which loaded the layout
The views were defined there, the events were handled there.

In order to do multiple pages I have started again using B4XPages
The project gets me
Main
B4XMainPage

I add a B4XPage called EditPage
I add a layout called editlayout
I add views to that.
When I generate members, the code gets added to Main, no matter what I do.
Shouldnt I be able to put this code into the EditPage module?


MAIN actually has a system provided comment that says
'Program code should go into B4XMainPage and other pages.

How?

What would I put inside the generated
B4X:
Sub Pane1_Touch (Action As Int, X As Float, Y As Float)
    
End Sub

And if all such code goes into MAIN, how can you have views on two layouts with the same names?
 

aeric

Expert
Licensed User
Longtime User
Make sure you click/highlight/set focus to the tab you want to target the code generation of view after you open the designer form and make sure the Target show the correct B4XPage.

 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…