0

Very new to B4A and programming in general.

I am creating an app that uses TabHost. On the main screen I will have about 25 buttons, each leading to its own screen. My question is what's the best way to go about doing this. Do I make each screen a new activity? Any guidance would be much appreciated

JonPM
  • 129
  • 1
  • 7

1 Answers1

1

It depends on how you want to structure your code and how complicated it is. You can just use Panels on your Main activity if it is simple enough, or use separate activities if each button does a more complex operation.

thedesolatesoul
  • 138
  • 1
  • 6
  • A tutorial about multiple activities is available [here](http://www.basic4ppc.com/forum/showthread.php?p=38609). – Erel Oct 24 '11 at 14:31
  • Each page is comprised of a calculator (and there are about 25 different calculators I'm using). They are independent of each other and don't share any coding/calculations. I am basically looking for the best way to accomplish this. I will of course need to incorporate the hardware back button so the users can easily go back to the previous screen. How does it work with panels? Do I have to change their visibilities depending on which button the user clicked? (i.e. if button1.clicked show screen1, hide all others)? – JonPM Oct 24 '11 at 17:21
  • Because all of your calculators are independent, I would suggest using separate activities since it will be easier to manage code. With panels, you will have to set the visibility of each panel, and also intercept the 'back' button to show the main panel. – thedesolatesoul Oct 24 '11 at 18:51
  • Thank you! That's kind of what I was thinking. Will look into this some more now. Much appreciated – JonPM Oct 25 '11 at 00:28