title: Floating Action Button in Fragment
body: <p>I am trying to add a floating action button to my fragment however I am getting an error when creating it using findViewById.</p>
  
  <pre><code>public class HomeFragment extends Fragment {
  
  FloatingActionButton fab;
  
  @Nullable
  @Override
  public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
      return inflater.inflate(R.layout.fragment_home, container,false);
  
      fab = (FloatingActionButton) getView().findViewById(R.id.fab);
      fab.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              startActivity(new Intent(getActivity(), ProfileActivity.class));
          }
      });
  }
  
  }
  </code></pre>
  
  <p>Error: fab = (FloatingActionButton) getView().findViewById(R.id.fab);</p>
  
  <p>"Unreachable statement"</p>