title: setHomeButtonEnabled on toolbar in a fragment
body: <pre><code>Android studio 1.3
  com.android.support:appcompat-v7:22.1.1
  </code></pre>
  
  <p>Hello,</p>
  
  <p>I am using the new toolbar and displaying in my fragment. However, I want to be able to navigate back to the previous fragment by having the <code>setHomeButtonEnabled(true)</code>. However, in my fragment in the onCreateView there is no such function. This works in the Activity, but doesn't work in the fragment. </p>
  
  <p>Is there anyway to have the toolbar display the setHomeButtonEnabled so that an arrow is displayed so the user can nagivate back.</p>
  
  <pre><code>public class FileTransferFragment extends Fragment {
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          setHasOptionsMenu(true);
  
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          View view = inflater.inflate(R.layout.fragment_file_transfer, container, false);
  
          final Toolbar toolbar = (Toolbar)view.findViewById(R.id.app_bar);
          AppCompatActivity appCompatActivity = (AppCompatActivity)getActivity();
          appCompatActivity.setSupportActionBar(toolbar);
  
      /* TRIED THIS BUT DIDN'T WORK */
          appCompatActivity.getActionBar().setHomeButtonEnabled(true);
          appCompatActivity.getActionBar().setDisplayHomeAsUpEnabled(true);
          return view;
      }
  }
  </code></pre>
  
  <p>In my Activity I am extending the <code>AppCompatActivity</code> and using <code>appcompat-v7:22.1.1</code></p>
  
  <pre><code>public class FileTransferActivity extends AppCompatActivity {
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_file_transfer);
  
          if(savedInstanceState == null) {
              FragmentManager fragmentManager = getFragmentManager();
              FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
              fragmentTransaction.add(R.id.fragment_container,
                      FileTransferFragment.getFileTransferFragment(1234), "FileTransferFragment");
              fragmentTransaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
              fragmentTransaction.commit();
          }
      }
  }
  </code></pre>
  
  <p>As you can see on the image there is no arraw on the left of the toolbar to allow the user to nagivate back.
  <img src="https://i.stack.imgur.com/hFqRg.png" alt="enter image description here"></p>