title: Layout puzzle development in Android
body: <p>I am a newbie in Android. </p>
  
  <p>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. </p>
  
  <p>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. </p>
  
  <p>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.</p>
  
  <p><strong>UPDATED :</strong> </p>
  
  <p>@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 <a href="http://www.stealthcopter.com/blog/2010/09/android-creating-a-custom-adapter-for-gridview-buttonadapter/" rel="nofollow">this site</a>.</p>
  
  <p>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.</p>
  
  <p><strong>NEW UPDATIONS ON Trials :</strong> </p>
  
  <p>@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. </p>
  
  <ul>
  <li>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.</li>
  <li>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.</li>
  <li><p>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. </p></li>
  <li><p>So with this I got 2 activity, FooFoo that shows DataActivity/Exit &amp; DataActivity that returns to FooFoo. Its a cycle that starts &amp; 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 <strong><em>Write Once Use Multiple Times</em></strong>. Also got to change button styles dynamically of all these pages buttons. </p></li>
  </ul>
  
  <p>Thanks</p>