title: Android, java.lang.IllegalArgumentException: No view found for id [..] for fragment [..]
body: <p>I try to open a dialog in which I have a FrameLayout. While loading a fragment in the Layout I get this exception:</p>
  
  <pre><code> java.lang.IllegalArgumentException: No view found for id 0x7f080044 (...id/selectionlayout) for fragment ScenesFragment{4166e8a0 #3 id=0x7f080044}
  </code></pre>
  
  <p>I loaded the Parentlayout correctly and everything else seems correct as well.</p>
  
  <pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(main);
  // Get the layout inflater
  LayoutInflater inflater = main.getLayoutInflater();
  final View v = inflater.inflate(R.layout.selectiondialog, null);
  main.getSupportFragmentManager().beginTransaction().replace(R.id.selectionlayout,scenegroups).commit();
  builder.setView(v);
  </code></pre>
  
  <p>selectiondialog.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:padding="10dp" &gt;
  
  &lt;Button
      android:id="@+id/sceneselect_back"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:text="back" /&gt;
  
  &lt;FrameLayout
      android:id="@+id/selectionlayout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  &lt;/FrameLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Why do I get the exception?</p>
  
  <p><strong>EDIT:
  It works now.It didn't do the trick, because the FrameLayout was not instanciated. I simply used</strong>   </p>
  
  <pre><code>main.getSupportFragmentManager().beginTransaction().replace(fl.getId(), scenegroups);
  </code></pre>