What you want are two fragments, one for the article view and one for the article detail view. You then would have an activity (or two) to manage them based on phone versus tablet. The fragments would communicate back to the base activity when something happens, say a touch on the article view, and the base activity would react as needed based on which type of device it's on. So if it's a tablet, where the base activity is managing both fragments, it would simply call a method on the article detail fragment. If it was on a phone, the base activity would use an intent to start the second activity. Make sense?
Chris Stewart http://locomolabs.com On Aug 22, 2011, at 5:30 PM, bob wrote: > Ok, let's say you are working on a news app. > > So, you have a ListView with some article titles. > > Then, when an article is clicked you have a TextView that replaces the > ListView. > > What is the best way to do this? > > I'm thinking of having the ListView and TextView on top of each other > in an AbsoluteLayout and showing/hiding as needed. > > Or, I can create two XML files and using setContentView as needed. > > Any ideas? > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en