title: Nested Fragments working on pre API 17
body: <p>I'm very confused. <a href="https://stackoverflow.com/questions/15608935/best-practice-for-nested-fragments-in-android-4-0-4-1-4-2-without-using-the">Here it says:</a> </p>
  
  <blockquote>
    <p>nested fragments as shown in the screenshot are not possible without the support library.</p>
  </blockquote>
  
  <p>and also <a href="https://stackoverflow.com/questions/6672066/fragment-inside-fragment/6672688#6672688">here they said</a>:</p>
  
  <blockquote>
    <p>AFAIK, fragments cannot hold other fragments.</p>
  </blockquote>
  
  <p>All this are confirmed by the <a href="http://developer.android.com/about/versions/android-4.2.html#NestedFragments" rel="nofollow noreferrer">Android Documentation here</a>.
  So that means one thing: </p>
  
  <blockquote>
    <p>You can't put Fragments into Fragments without Support v4 Library on pre API 17!</p>
  </blockquote>
  
  <p>Ok, but when I have the following settings:
  build.gradle</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  
  android {
      compileSdkVersion 16
      buildToolsVersion '19.1.0'
  
      defaultConfig {
          applicationId "package.supportfragments"
          minSdkVersion 14
          targetSdkVersion 16
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
  }
  </code></pre>
  
  <p>MainActivity:</p>
  
  <pre><code>public class MainActivity extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      getFragmentManager().beginTransaction().add(R.id.frame_test, new TestFragment()).commit();
  }
  </code></pre>
  
  <p>TestFragment:</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      View rootView = inflater.inflate(R.layout.fragment_test, container, false);
  
      getFragmentManager().beginTransaction().add(R.id.frame_test_2, new TestNestedFragment()).commit();
  
      return rootView;
  }
  </code></pre>
  
  <p>TestNestedFragment:</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      View rootView = inflater.inflate(R.layout.fragment_test_nested, container, false);
  
      getFragmentManager().beginTransaction().add(R.id.frame_test_3, new TestNestedNestedFragment()).commit();
  
      return rootView;
  }
  </code></pre>
  
  <p>The Layout looks all like that:</p>
  
  <pre><code>&lt;FrameLayout 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" &gt;
  
     &lt;!-- TODO: Update blank fragment layout --&gt;
     &lt;FrameLayout
         android:id="@+id/IDTOTHEFRAGMENT"
         android:layout_width="match_parent"
         android:layout_height="match_parent" /&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>And it works like a charme... The question is.. WHY??!!</p>