title: Adding a button listener in a fragment
body: <p>I am trying to add a button listener to a fragment view in Android. When I tap the "Like" or "Dislike" buttons, nothing appears to happen. I don't get the "dislikeClicked" or "likeClicked" in my Logcat view. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>    public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState )
      {
          queryForData();
          View rootView = inflater.inflate(R.layout.fragment_view1,  container, false );
          likeButton = (Button) rootView.findViewById(R.id.view1_likeButton);
          likeButton.setOnClickListener(new View.OnClickListener() {
              public void onClick(View v) {
                  Log.d("likeClicked", "");
                  like();
              }
          });
          dislikeButton = (Button) rootView.findViewById(R.id.view1_dislikeButton);
          dislikeButton.setOnClickListener(new View.OnClickListener() {
              public void onClick(View v) {
                  Log.d("dislikeClicked", "");
                  dislike();
              }
          });
      return rootView;
      }
  </code></pre>
  
  <p>Any help is appreciated. 
  Thanks!</p>