> I have an application that contains three main title screens/ > activities, let's call the A,B, and C. The user switch from screen A-- >>B-->C, and back to A at the touch of a button. The user can also > exit the application on any screen (via the menu). > > Should I be using startActivity to switch between the activities, or > startSubActivity?
IMHO, only use startSubActivity() if there is a clear parent-child relationship between the caller and the to-be-started activity. If they are peers, use startActivity(). That being said, is there any particular reason why you're building your UI using three activities? Are there ways to launch into, say, activity B without involving activities A or C? If all you're looking for is three UI perspectives in an activity, use ViewFlipper. I used that for the TourIt sample program for my book, and it works pretty nicely. > Also, if using startSubActivity, is there a good way to implement this > navigation such that when I switch to the same screen twice, such as > A-->B-->A, that the second A is not an entirely new activity, but > rather goes back to the original A activity? Check out the android:launchMode attribute in the manifest: http://code.google.com/android/reference/android/R.attr.html#launchMode The singleTop value might be what you're looking for. -- 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 [email protected] 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 -~----------~----~----~----~------~----~------~--~---

