I need to develop fragments layouts for both portrait and landscape. In landscape mode, both fragments should be displayed and in portrait mode, only first fragment should be displayed and when the user swaps the screen, then the second fragment is displayed. Similar to these screens. But I don't have any ListView as the given tutorial. I am using Android.app Fragments
so I cannot use OnItemSelectedListener
to swap to the second fragment when in the portrait screen.
I know there is no ViewPager
in android.app
. So I'm confused and my question is, do I have to use both android.support.v4.app
library (to swap fragments)and Android.app
Fragments(to display both fragments in landscape mode) in this scenario or else is there any other way to accomplish this?
NOTE: I have read this question but I could not get an answer for my problem.