Android - Button won't switch fragments
<p>I've been trying to get my floating action button to work in my fragment to where it switches and does a slide animation to the next fragment but for some reason when I click on the floating action button, it does nothing. Can someone help me point out why.</p>

<p>Here is my fragment class</p>

<pre><code>import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/**
 * A simple {@link Fragment} subclass.
 */
public class ScoutFragment extends Fragment {

    FloatingActionButton addDataScout;

    public ScoutFragment() {
        // Required empty public constructor
    } //End of ScoutFragment

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_scout, container, false);

        //Setup Floating Action Button
        FloatingActionButton addDataScout = (FloatingActionButton) view.findViewById(R.id.fab);
        addDataScout.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                AddScoutDataFragment fragment = new AddScoutDataFragment();
                FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
                fragmentTransaction.setCustomAnimations(R.anim.enter_from_right, R.anim.exit_to_left);
                fragmentTransaction.replace(R.id.fragment_container, fragment);
                fragmentTransaction.commit();
            } //End of onClick
        }); //End of setOnClickListener

        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_scout, container, false);
    } //End of onCreateView
} //End of class
</code></pre>

<p>Here is the xml file</p>

<pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.compscitutorials.basigarcia.ramfernoscout.ScoutFragment"&gt;

    &lt;RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"&gt;

        &lt;android.support.design.widget.FloatingActionButton
            android:id="@+id/fab"
            android:layout_width="61dp"
            android:layout_height="57dp"
            android:src="@mipmap/ic_action_add"
            app:backgroundTint="#F28016"
            app:elevation="5dp"
            app:borderWidth="0dp"
            android:layout_alignParentBottom="true"
            android:layout_alignParentEnd="true"
            android:layout_marginBottom="12dp"
            android:layout_marginRight="10dp"
            android:scaleType="fitCenter"
            android:clickable="true"&gt;
        &lt;/android.support.design.widget.FloatingActionButton&gt;

        &lt;TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Western University"
            android:id="@+id/testText"
            android:layout_centerInParent="true"
            android:textSize="24dp"
            android:textStyle="bold" /&gt;
    &lt;/RelativeLayout&gt;
&lt;/FrameLayout&gt;
</code></pre>

<p>I am also using <code>NavigationDrawer</code> for my project</p>