title: OnClickListener not working for textview
body: <p>I am trying to start a new fragment when a textView is presses. I have tried alternative methods but still the onClickListener is not working. I have no crashes, nothing. I have also tried with buttons, or creating the onClick method in the OncreateView method and setting a listener.</p>
  
  <pre><code>Fragment:package georgia.languagelandscape.fragments;
  
  import android.content.Context;
  import android.net.Uri;
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.support.v4.app.FragmentManager;
  import android.support.v4.app.FragmentTransaction;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ListView;
  import android.widget.TextView;
  
  import georgia.languagelandscape.R;
  
  //import android.support.v4.app.Fragment;
  
  
  /**
   * A simple {@link Fragment} subclass.
   * Activities that contain this fragment must implement the
   * {@link ProfileFragment.OnFragmentInteractionListener} interface
   * to handle interaction events.
   * Use the {@link ProfileFragment#newInstance} factory method to
   * create an instance of this fragment.
   */
  public class HelpFragment extends Fragment implements MyProjectsFragment.OnFragmentInteractionListener, View.OnClickListener {
      // TODO: Rename parameter arguments, choose names that match
      // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
      private static final String ARG_PARAM1 = "param1";
      private static final String ARG_PARAM2 = "param2";
  
      // TODO: Rename and change types of parameters
      private String mParam1;
      private String mParam2;
  
      private FragmentManager fm = null;
      private FragmentTransaction ft = null;
  
      private OnFragmentInteractionListener mListener;
  
      public HelpFragment() {
          // Required empty public constructor
      }
  
      /**
       * Use this factory method to create a new instance of
       * this fragment using the provided parameters.
       *
       * @param param1 Parameter 1.
       * @param param2 Parameter 2.
       * @return A new instance of fragment ProfileFragment.
       */
      // TODO: Rename and change types and number of parameters
      public static HelpFragment newInstance(String param1, String param2) {
          HelpFragment fragment = new HelpFragment();
          Bundle args = new Bundle();
          args.putString(ARG_PARAM1, param1);
          args.putString(ARG_PARAM2, param2);
          fragment.setArguments(args);
          return fragment;
      }
  
      private ListView mListView;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          if (getArguments() != null) {
              mParam1 = getArguments().getString(ARG_PARAM1);
              mParam2 = getArguments().getString(ARG_PARAM2);
          }
  
  
  
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          // Inflate the layout for this fragment
       //   String frameVideo = "&lt;html&gt;&lt;body&gt;Youtube video .. &lt;br&gt; &lt;iframe width=\"320\" height=\"315\" src=\"https://www.youtube.com/embed/lY2H2ZP56K4\" frameborder=\"0\" allowfullscreen&gt;&lt;/iframe&gt;&lt;/body&gt;&lt;/html&gt;";
  
          View rootview = inflater.inflate(R.layout.fragment_help, container, false);
  
          TextView tv= (TextView) rootview.findViewById(R.id.item1);
          tv.setFocusableInTouchMode(false);
          tv.setOnClickListener(this);
  
  
      /*   WebView display = (WebView) rootview.findViewById(R.id.webView);
          display.setWebViewClient(new WebViewClient(){
              @Override
              public boolean shouldOverrideUrlLoading(WebView view, String url) {
                  return false;
              }
          });
          WebSettings webSettings = display.getSettings();
          webSettings.setJavaScriptEnabled(true);
          display.loadData(frameVideo, "text/html", "utf-8");*/
  
  
  
  
          return inflater.inflate(R.layout.fragment_help, container, false);
  
  
  
      }
  
      // TODO: Rename method, update argument and hook method into UI event
      public void onButtonPressed(Uri uri) {
          if (mListener != null) {
              mListener.onFragmentInteraction(uri);
          }
      }
  
      @Override
      public void onAttach(Context context) {
          super.onAttach(context);
          if (context instanceof OnFragmentInteractionListener) {
              mListener = (OnFragmentInteractionListener) context;
          } else {
              throw new RuntimeException(context.toString()
                      + " must implement OnFragmentInteractionListener");
          }
      }
  
      @Override
      public void onDetach() {
          super.onDetach();
          mListener = null;
      }
  
      @Override
      public void onClick(View v) {
  
              switch (v.getId()) {
                  case R.id.item1:
                      MyProjectsFragment myProjectsFragment= new MyProjectsFragment();
                      fm = getFragmentManager();
                      ft = fm.beginTransaction();
                      Log.d("dcf","da");
                      ft.replace(R.id.content_replace, myProjectsFragment);
                      ft.commit();
                      break;
                  /*case R.id.item2:
                      //Do what you want for create_button
                      break;
                  default:
                      break;*/
              }
  
  
      }
  
  
      /**
       * This interface must be implemented by activities that contain this
       * fragment to allow an interaction in this fragment to be communicated
       * to the activity and potentially other fragments contained in that
       * activity.
       * &lt;p&gt;
       * See the Android Training lesson &lt;a href=
       * "http://developer.android.com/training/basics/fragments/communicating.html"
       * &gt;Communicating with Other Fragments&lt;/a&gt; for more information.
       */
      public interface OnFragmentInteractionListener {
          // TODO: Update argument type and name
          void onFragmentInteraction(Uri uri);
      }
  
      @Override
      public void onFragmentInteraction(Uri uri) {
      }
  
  
  }
  </code></pre>
  
  <p>xml: </p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="georgia.languagelandscape.fragments.HelpFragment"
      android:background="@android:color/background_light"
      tools:background="@android:color/white"&gt;
  
  
  
              &lt;TextView
                  android:text="Help"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="17dp"
                  android:id="@+id/textView"
                  android:textSize="30sp"
                  android:textStyle="normal|bold"
                  android:textColor="#000"
                  android:layout_alignParentTop="true"
                  android:layout_centerHorizontal="true"/&gt;
      &lt;TextView
          android:id="@+id/item1"
          android:layout_width="50dp"
          android:layout_height="50dp"
          android:layout_marginTop="100dp"
          android:layout_marginLeft="50dp"
          android:text="item1"
          android:clickable="true" /&gt;
  
  
              &lt;WebView
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:id="@+id/webView"
                  android:layout_marginTop="100dp"
                  android:padding="10dp"
                  android:layout_below="@+id/textView"
                  android:layout_alignParentLeft="true"
                  android:layout_alignParentStart="true" /&gt;
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>