Fragments / Navigation Drawer Overlapping TableLayout?
<p>I need help with my code. I'm trying to use the Navigation Drawer code Android Studio gives you by default. The starting screen is the content_main.xml and the problem is if I put a textview or anything else on the content_main, it appears on the other fragment/activities when switching.</p>

<p>My Code (I have two fragments, A relativeLayout &amp; a TableLayout but I'll use one for simplicity):</p>

<p>Registration_fragment.java</p>

<pre><code>public class Registration_fragment extends Fragment {
View myView;
@Nullable @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    myView = inflater.inflate(R.layout.registration_frag,container,false);
    return myView;
}
</code></pre>

<p>content_main.xml</p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"

app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.company.myName.projectname.MainActivity"
tools:showIn="@layout/app_bar_main"&gt;

&lt;FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/content_frame"
&gt;
&lt;/FrameLayout&gt;
</code></pre>

<p></p>

<p>registration_frag.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/testFrag"&gt;

&lt;TableRow&gt;
&lt;TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/first_name"
    android:layout_marginLeft="10dp"
    android:id="@+id/fnametext"
    /&gt;
  &lt;/TableRow&gt;
  ... &lt;/TableLayout&gt;
</code></pre>

<p>MainActivity.java</p>

<pre><code> public boolean onNavigationItemSelected(MenuItem item) {
    // Handle navigation view item clicks here.
    int id = item.getItemId();
    android.app.FragmentManager fragmentManager = getFragmentManager();
    if (id == R.id.nav_registration) {
        // Handle the camera action
        fragmentManager.beginTransaction().replace(R.id.content_frame,
                new Registration_fragment()).commit();

    } else if (id == R.id.nav_records) {
        fragmentManager.beginTransaction().replace(R.id.content_frame,
                new Records_fragment()).commit();
    } else if (id == R.id.nav_signup) {

    } else if (id == R.id.nav_manage) {

    } else if (id == R.id.nav_share) {

    } else if (id == R.id.nav_send) {

    }

    DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    drawer.closeDrawer(GravityCompat.START);
    return true;
}
</code></pre>

<p>I could really use some help understanding the concept.</p>