title: Android added Fragment to screen, but taps fall through new Fragment view to the previous one
body: <p>I'm working with Fragments for the first time and running into a weird behavior. I have an activity with a Fragment covering the entire view. It contains a ListView. When I tap on an item in the ListView, I want to show a details fragment which contains information about that item.</p>
  
  <p>This is how I'm presenting the new fragment view:</p>
  
  <pre><code>FragmentManager fragmentManager = this.getActivity().getSupportFragmentManager();
  FragmentTransaction transaction = fragmentManager.beginTransaction();
  
  DetailsFragment fragment = new DetailsFragment();
  transaction.add(R.id.viewRoot, fragment).setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
                  .addToBackStack("Details").commit();
  </code></pre>
  
  <p>R.id.viewRoot is the id of the root layout in the first Fragment's layout xml, so the new Fragment fills the entire screen.</p>
  
  <p>My Problem: When the new fragment is visible and covering the entire screen, any clicks or taps which land on the background (i.e. not hitting a button or textfield on the new fragment) appear to be going through the view and landing on the first fragment. So, I tap on a ListView item, which causes the DetailsFragment to get added to the screen. Then when I tap on the background of the DetailsFragment, that tap falls through and lands on the ListView causing another DetailsFragment to be added for whatever item I happened to hit behind the scenes.</p>
  
  <p>Am I adding my new fragment incorrectly? Why are my clicks/taps falling through?</p>
  
  <p>EDIT for caiuspb:</p>
  
  <pre><code>public class BaseFragment extends Fragment {
  
      public void pushNewFragment(Fragment fragment, String description) {
          FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
          FragmentTransaction transaction = fragmentManager.beginTransaction();
  
          transaction.remove(this);
          transaction.add(R.id.viewRoot, fragment).setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
                          .addToBackStack(description).commit();
      }
  
  }
  </code></pre>
  
  <p>All of my fragments extend my BaseFragment class.</p>