I have an application that uses `ActionBar` tabs for navigation. With these tabs I use `FragmentPagerAdapter` with a `ViewPager` in the layout.

I have configured these in my application's main `Activity`. In there I add a page change listener for the `ViewPager` and change tabs regarding to position. I also do it the other way around when a tab is pressed. This is all fine.

Then I have the contents I have in the tabs. Both of them extend `Fragment` class. The first one has to change the layout according to the device. On landscape tablets (`layout-sw600dp-land`) I have a layout with two fragments and other devices will have only one fragment. This is done by two layout files in appropiate folders. 

On these smaler devices, the second fragment is used as a dialog.

I'm not really sure how to implement this all. The first fragment contains a ListView with all kind of tasks. When one of those is clicked, an editing window should appear to the right fragment. On small devices, the fragment doesn't exist so it needs to be started as an Activity. Currently this editing window is a `FragmentActivity`. 

How do I do this? I'm not sure if it's really harder, but I think the Fragment inside Fragment confuses me.