title: Android Fragment Interface Unresponsive
body: <p>I am having a strange issue with my program that I cannot explain and I have thus far not been able to find a solution. I have a simple activity that will switch between fragments and run the user through an initial setup of the app. The first fragment is just a text view at the top, with a button on the bottom with an onClickListener set to call a method on the parent activity, however in testing, when I click on the button, nothing happens. It does not change color like a normal button would, and no click seems to be registered.</p>
  
  <p>Here is the XML for the layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" &gt;
  
  &lt;TextView
      android:id="@+id/textView1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentTop="true"
      android:text="@string/setup_intro" /&gt;
  
  &lt;Button
      android:id="@+id/next_button"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:layout_centerHorizontal="true"
      android:clickable="true"
      android:width="72dp"
      android:text="@string/next_button" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>And this is the fragment code where I implement the onClickListener</p>
  
  <pre><code>public class SetupFragmentInitialScreen extends SherlockFragment
  {
      @Override
      public View onCreateView(LayoutInflater inflater, 
                               ViewGroup container,
                               Bundle savedInstanceState)
      { 
          View parentView = null; 
          parentView = inflater.inflate(R.layout.setup_fragment_initial_screen, 
                                        container, 
                                        false);
  
          Button nextButton = (Button)parentView.findViewById(R.id.next_button);
          nextButton.setOnClickListener(new OnClickListener()
          {
              @Override
              public void onClick(View v) 
              {
                  Log.v("ButtonPressed", "You Pressed the button!");
                  ((InitialActivity)getActivity()).onInitialScreenNextPress();
              }
          });
  
          return parentView;
      }
  }
  </code></pre>
  
  <p>And lastly, here is my code for my activity so far</p>
  
  <pre><code>public class InitialActivity extends SherlockFragmentActivity
  {
      private SetupFragmentInitialScreen initialScreen;
      private SetupFragmentPreferenceOneScreen preferenceOneScreen;
  
      @Override
      public void onCreate(Bundle savedInstanceState) 
      {    
          super.onCreate(savedInstanceState);
  
          initialScreen = new SetupFragmentInitialScreen();
          preferenceOneScreen = new SetupFragmentPreferenceOneScreen();
  
          FragmentManager fragmentManager = getSupportFragmentManager();
          FragmentTransaction fragmentTransaction = 
              fragmentManager.beginTransaction();
  
          fragmentTransaction.setCustomAnimations(android.R.anim.fade_in, 
                                                  android.R.anim.fade_out);
  
          fragmentTransaction.replace(android.R.id.content, 
                                      initialScreen);
  
          fragmentTransaction.commit();
      }
  
      public void onInitialScreenNextPress()
      {
          FragmentManager fragmentManager = getSupportFragmentManager();
          FragmentTransaction fragmentTransaction = 
              fragmentManager.beginTransaction();
  
          fragmentTransaction.setCustomAnimations(android.R.anim.fade_in, 
                                                  android.R.anim.fade_out);
  
          fragmentTransaction.replace(android.R.id.content, 
                                      preferenceOneScreen);
  
          fragmentTransaction.addToBackStack(null);
          fragmentTransaction.commit();
      }
  }
  </code></pre>
  
  <p>So far the code to me seems correct, but as I said, there is no reaction from the interface when I try to press the button.</p>
  
  <p>Edit: I have added the following code to my Activity to check for touch events</p>
  
  <pre><code>@Override
  public boolean onTouchEvent(MotionEvent event)
  {
      super.onTouchEvent(event);
  
      Log.v("Touch Detected", "You are touching the screen.");
  
      return false;
  }
  </code></pre>
  
  <p>It logs events all over the screen, except for when I'm touching the button, so the activity is receiving touch events, but the UI itself is not. I also tried loading another interface which has a pair of radio buttons, and they too were unresponsive. Is there something I'm doing wrong with initializing the fragments?</p>