0

This is related to my last post, but i need a solution quickly so i'm trying to simplify the problem.

All i want to do i having several fragments (one list at the left and a detail view at the right) in one tab.

Do you have an idea ?

An-droid
  • 6,433
  • 9
  • 48
  • 93

1 Answers1

2

If you know what the two Fragments are in advance just declar them both within the XML layout file for that tab. You can see how to do this in the fragment tutorial from the android docs. This will display two fragments in one activity using an outer layout element as a container.

Rarw
  • 7,645
  • 3
  • 28
  • 46
  • My app use tabadapter + view pager : ONE activity SEVERAL fragments tab. What i want is to replace one fragment/tab by the correct layout in ccordance to the oriantation of the device and the type (handset/tablet) i need some guidance because i have no idea how to do this. using layout and layout-land can help but the problem is still here. Either i declare the tab/fragment in xml and i can't replace them in the code either i declare some so i can replace it with FragmentTransaction but where ?... – An-droid Jul 25 '13 at 12:57
  • I don't understand what you mean by where? If you're going to add them using the `FrameLayout` then the `FrameLayout` is in your hosting activity. The fragments are selected by the tabs and, when screen size changes you adapt the fragments accordingly. Are you not understanding how to adjust for the size/orientation change? That's a different question. – Rarw Jul 25 '13 at 13:22
  • My last post http://stackoverflow.com/questions/17815305/abs-viewpager-manage-orientation-change / one tab = one fragment + his layout / that is what i what to change – An-droid Jul 25 '13 at 13:25
  • Ok - I think I understand now. [check out this post](http://stackoverflow.com/questions/13816442/viewpager-with-one-page-containing-multiple-fragments-java-lang-illegalargument) it shows how to put multiple fragments within one page of a viewpager. If you combine that with the tab tutorial you linked to you should be able to solve this problem. – Rarw Jul 25 '13 at 14:13