title: Android FrameLayout is not replace by Fragments
body: <p>This app contains <code>activity_main.xml</code>, <code>mainactivit.java</code> and one Fragment class.
  <code>activity_main.xml</code> has one Button and <code>FrameLayout</code> inside  <code>RelativeLayout</code>.
  When the Button is clicked, <code>FrameLayout</code> should be replaced by fragments, but it doesn't get replaced.</p>
  
  <p><strong>activity_main.xml</strong></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"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context=".MainActivity" &gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical" &gt;
  
          &lt;Button
              android:id="@+id/button2"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:onClick="loadd"
              android:text="Fragment No.2" /&gt;
  
          &lt;FrameLayout
              android:id="@+id/maincontainer"
              android:layout_width="match_parent"
              android:layout_height="match_parent" /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>mainactivity.java</strong></p>
  
  <pre><code>public class MainActivity extends FragmentActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
      }
  
      public void loadd(View v) {
          try {
              Fragment fragment = new fr();
              FragmentManager frgManager = getSupportFragmentManager();
              FragmentTransaction trans = frgManager.beginTransaction();
              trans.replace(R.id.maincontainer, fragment);
              trans.commit();
          } catch (Exception e) {
              Toast.makeText(MainActivity.this, "error " + e.getMessage(), Toast.LENGTH_LONG).show();
          }
      }
  
  }
  </code></pre>
  
  <p><strong>Fragment class</strong></p>
  
  <pre><code>public class fr extends Fragment{
      public View OnCreateView(LayoutInflater inf,ViewGroup parent,Bundle save){
          return inf.inflate(R.layout.send,parent, false);
          }
  }
  </code></pre>
  
  <p><strong>send.xml</strong></p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/container3"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;TextView
          android:id="@+id/textmsg"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Fragment 3" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>There is no compile time or run time error, but when I click that Button <code>the FrameLayout</code> is not replaced by the <code>Fragment</code>.</p>