title: Creating a Multi-pane layout using android actionbar and navigation drawer
body: <p>I'm currently creating an app which can handle different screen support and multi-pane view using fragments. Now I used the default navigation drawer and actionbar using android studio and created two fragments to test for this and layouts for portrait: fragment_1 and fragment_2 which just replaces the container on the MainActivity. But now the problem is how can I implement the fragment_1 and fragment_2 in 1 layout? I Tried to research on the multi-pane development on this <a href="http://www.vogella.com/tutorials/AndroidFragments/article.html" rel="nofollow">link</a> but I think to properly implement it I need to use an ActivityFragment but in this case I am limited on using just Fragments which is why I'm lost on what to do. Here's the code so far:</p>
  
  <pre><code>@Override
      public void onNavigationDrawerItemSelected(int position) {
          // update the main content by replacing fragments
          FragmentManager fragmentManager = getSupportFragmentManager();
          switch (position) {
              case 0:
                          fragmentManager.beginTransaction()
                          .replace(R.id.container, FragmentMain.newInstance(position + 1))
                          .commit();
                  break;
              case 1:
                  fragmentManager.beginTransaction()
                          .replace(R.id.container, FragmentAbout.newInstance(position + 1))
                          .commit();
                  break;
              /*create the other cases here for navigation*/
          }
      }
  </code></pre>
  
  <p>fragment_main.xml (the 1st fragment)</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.kahel.main.MainActivity$PlaceholderFragment"&gt;
      &lt;android.support.v4.widget.SwipeRefreshLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/swipe_container"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
          &lt;ListView
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:id="@+id/list_news"
              android:choiceMode="singleChoice" /&gt;
      &lt;/android.support.v4.widget.SwipeRefreshLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>fragment_about.xml (2nd fragment)</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.kahel.main.MainActivity$PlaceholderFragment"&gt;
      &lt;android.support.v4.widget.SwipeRefreshLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/swipe_container"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
          &lt;ListView
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:id="@+id/list_news"
              android:choiceMode="singleChoice" /&gt;
      &lt;/android.support.v4.widget.SwipeRefreshLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>fragment_main.xml (landscape)</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.kahel.main.MainActivity$PlaceholderFragment"
      android:orientation="horizontal"
      android:weightSum="1"&gt;
      &lt;android.support.v4.widget.SwipeRefreshLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/swipe_container"
          android:layout_width="@dimen/land_scoop_feed"
          android:layout_height="match_parent"&gt;
          &lt;ListView
              android:layout_width="150dp"
              android:layout_height="match_parent"
              android:id="@+id/list_news"
              android:choiceMode="singleChoice" /&gt;
      &lt;/android.support.v4.widget.SwipeRefreshLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>When I tried to change the layout it just force close my app. :/</p>
  
  <p>Please let me know what to do or what to search for. Thanks! :)</p>