> But now i want to change my code... > I want that there should be only one class that extends Activity(say > main_activity). > And then i want the two classes TermsScreen.java and LoginScreen.java > should get reference of that main_activity class. > > I wrote code for all this and again made use of INTENT for switching > but its not working. > Can anyone please tell me will INTENT work or should i use something > else to go from TermsScreen.java to LoginScreen.java
Intents are for switching between activities (among other uses), not for changing the UI of a single activity. You can try calling setContentView() to the new UI when it is time to switch, but I am not certain that will work. What will work is to use ViewFlipper or another concrete ViewGroup subclass. These work like tabbed windows (i.e., multiple discrete "screens"), just without the actual tabs -- you are responsible for switching between them as needed. It will require some reworking of your code, such as perhaps combining the two layout XML files into one. The Animation2.java sample in the ApiDemos with the SDK uses ViewFlipper. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ -- Available Now! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---