I am a newbie in Android.
I want to develop an application where I can change the screens based on button selected. Application might endup with 20+ screens with buttons or entry form. From 1 screen I got to change the screen to some other screen. I thought of FrameLayout where I can change the children.
I am not getting a way to start up. Like I created an Activity. My each screen should exceed which class so I can add it to the Layout ? How do I make my first screen visible on start up.
These all seem to be simple and silly questions, but really I can't get a starting point for the same. Any help is appreciative to help me achieve my goal.
UPDATED :
@Ghost, from your solution 1 more question arised in my mind. For screens where I only have to show buttons in specific format, I added a GridView and a ButtonAdapter with the help of this site.
If I add clickListener in ButtonAdapter only, then how can I pass parameters to setIntent(FooFooActivity.this....) ????? I have the Conext in ButtonAdapter - I can typecast it to FooFooActivity and can that work on. I can give ifs in ButtonAdapter in onclick() to make t go to proper screen. But the setIntent cna work the way I am saying or something like that. If it can work, then for many screens my single GridView and single ButtonAdapter class can do all the work.
NEW UPDATIONS ON Trials :
@Ghost, I tried and found that the above setIntent(FooFooActivity.this....) in ButtonAdapter doesnot work - as in ButtonAdapter it wont find scope for FooFooActivity.this.
- In my FooFooActivity, I can't set onclikcListeners for buttons added via ButtonAdapter. I tried with gridview.getChild(i), but just doesn't set in any way.
- I also made another linearlayout xml (buttonspage.xml) with 6 buttons and a DataActivity that uses it. That works perfectly and on button click also shows FooFooActivity.
To use the same buttonspage.xml layout in multiple activities, I set the content of FooFooActivity as buttonspage and set its button click listeners. For 1 button I set to exit the application and for other button to show DataActivity.
So with this I got 2 activity, FooFoo that shows DataActivity/Exit & DataActivity that returns to FooFoo. Its a cycle that starts & ends up with FoofooActivity. If I click "Exit" at first, it quits. But If I click "Exit" after showing DataActivity, then it just doesn't quit and shows DataActivity only. Is it that I can't use same layout in multiple activity ?? Or may I be going wrong somewhere (I doubt so) ? Same buttonpage layout I got to use in 10-12 pages except with different text on button and events. So was thinking for Write Once Use Multiple Times. Also got to change button styles dynamically of all these pages buttons.
Thanks