Noob Help

SWIFTNET

New Member
:sign0104: Brand new user just looking for some tips, ive been working through some tutorials to get a feel for what this is capable of and so far it seems great !!

Basically the app has a main screen with 6 buttons, and each button has a different command, ie one opens browser to specific page etc which ive added fine.

So far ive been doing it all using layouts rather than panels, but want to know the best way to go. For example if you click button 1 i want it to go to "page2" , button 2 goes to "page3"

When i do it using loadlayout, the buttons from the previous screen are still visible. would i be better using panels, and if so how ? :sign0104:
 

wl

Well-Known Member
Licensed User
Longtime User
You can hook the events of all buttons to the same eventhandler (same code).

Then to determine the button on which was clicked you can read the "sender" value.

Moreover you can attach a tag value to all views so you can read the sender.tag which may contain the name of the panel, etc ...
 
Upvote 0

SWIFTNET

New Member
Panels / Layouts

thanks for the help

i just wonder if i am i best having the target pages set up as panels or new layouts. also how do i hide the buttons on layout 1 when the app changes to layout 2
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Basically Android works with different activities.
So with each button you should start a new activity do what you want and either go back to the main activity or launch a new activity.
It's no good practice to load a new layout to the current activity.
If you have a few screens you could use panels. Hiding and showing them according to the chosen function. You can load layouts to panels.
You should have a look at Different examples with two layouts.
Or at chapter 12.2 Program with 3 activities in the Beginner's Guide.

Best regards.


Best regards.
 
Upvote 0
Top