title: Access main activity FloatingActionButton from Fragments
body: <p>I have a an activity with 3 fragments. Each fragment has to have a FAB with different icon an action. 
  The FAB is defined on the main activity layout. Now I saw that I cannot access it from fragments. How can I do it?</p>
  
  <p>Here's my code:
  main_activity layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout
      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"
      tools:context=".MainActivity"&gt;
  
      &lt;android.support.v4.view.ViewPager
          android:id="@+id/view_pager"
          android:layout_width="match_parent"
          android:layout_height="0dp"
          app:layout_behavior="@string/appbar_scrolling_view_behavior"
          app:layout_constraintBottom_toTopOf="parent"
          app:layout_constraintTop_toBottomOf="parent"
          tools:layout_editor_absoluteX="16dp"&gt;
  
  
          &lt;android.support.design.widget.TabLayout
              android:id="@+id/tabs"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              app:tabGravity="fill"
              app:tabMode="fixed" /&gt;
      &lt;/android.support.v4.view.ViewPager&gt;
  
  
      &lt;android.support.design.widget.FloatingActionButton
          android:id="@+id/fab"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_margin="24dp"
          android:src="@android:drawable/ic_dialog_email"
          android:visibility="visible"
          app:layout_constraintBottom_toTopOf="parent"
          app:layout_constraintEnd_toEndOf="parent" /&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p>my fragment layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="horizontal" android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@color/colorBackgroundFragment"&gt;
  
      &lt;android.support.v7.widget.RecyclerView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:id="@+id/contact_recycleview"&gt;
  
      &lt;/android.support.v7.widget.RecyclerView&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>inflating the fragment:</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      v= inflater.inflate(R.layout.filters_fragment,container,false);
  
      myrecyclerview = (RecyclerView) v.findViewById(R.id.contact_recycleview);
      recyclerAdapter = new RecyclerViewAdapterCall(getContext(), lstCall);
      myrecyclerview.setLayoutManager(new LinearLayoutManager((getActivity())));
      myrecyclerview.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
      myrecyclerview.setAdapter(recyclerAdapter);
  
      return v;
  }
  </code></pre>
  
  <p>so here I'll like to change icon an action, how?</p>