title: onItemClickListener of ListView not working with RatingBar
body: <p>I have a list item click listener (<code>onItemClickListener</code>) inside the overridden <code>onViewCreated</code> method of a fragment. The method body is given below:</p>
  
  <pre><code>@Override
  public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
      final String uname = getActivity().getIntent().getExtras().getString("uname");
  
      list = (ListView) getActivity().findViewById(R.id.drlistforhome);
      list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
              Doctors doc = rh.drList.get(position);
              imgURL = doc.getDrProPic();
              docName = doc.getDrName();
              jobTitle = doc.getDrJobTitle();
              docSpeciality = doc.getDrSpeciality();
              docUname = doc.getDrUname();
              startActivity(new Intent(getActivity().getApplicationContext(), DoctorsProfileH.class).putExtra("img", imgURL)
                      .putExtra("name", docName)
                      .putExtra("title", jobTitle)
                      .putExtra("speciality", docSpeciality)
                      .putExtra("uname", uname)
                      .putExtra("druname", docUname));
          }
      });
  
  }
  </code></pre>
  
  <p>The custom list view layout consists of six views: 4 <code>TextView</code>s, an <code>ImageView</code> and a <code>RatingBar</code>. The <code>onItemClickListener</code> was listening to list item clicks until the <code>RatingBar</code> was not added. But now that I have added a <code>RatingBar</code> in my custom layout, the listener wouldn't listen the clicks anymore. I am using a custom adapter to set all the views. Here is my custom adapter:</p>
  
  <pre><code>class TDsAdapter extends ArrayAdapter&lt;Doctors&gt; {
          public TDsAdapter(){
              super(getActivity().getApplicationContext(),R.layout.custom_list_view,rh.drList);
          }
  
          @Override
          public View getView(int position, View convertView, ViewGroup parent) {
              View itemView = convertView;
              if (itemView == null) {
                  itemView = inflater.inflate(R.layout.custom_list_view, parent, false);
              }
              Doctors currentItem = rh.drList.get(position);
              TextView drName = (TextView) itemView.findViewById(R.id.drName);
              drName.setText(currentItem.getDrName());
  
              TextView drSpeciality = (TextView) itemView.findViewById(R.id.drSpeciality);
              drSpeciality.setText(currentItem.getDrSpeciality());
  
              TextView drJobTitle = (TextView) itemView.findViewById(R.id.drJobTitle);
              drJobTitle.setText(currentItem.getDrJobTitle());
  
              ImageView drProPic = (ImageView) itemView.findViewById(R.id.drPropic);
              Picasso.with(getContext()).load(currentItem.getDrProPic()).into(drProPic);
  
              TextView distence = (TextView) itemView.findViewById(R.id.dis);
              distence.setText(currentItem.getDis());
  
              RatingBar rb = (RatingBar) itemView.findViewById(R.id.ratingBar);
              rb.setRating((float) 2.5);
  
              return itemView;
          }
      }
  </code></pre>
  
  <p>After running the application the list view appears fine with the <code>RatingBar</code> as expected, but the list items are no longer clickable. When I debug the app with a break point inside the listener, that break point never gets executed. What I understand from my very little knowledge about fragments, this is probably because the <code>onViewCreated</code> is expecting all the views to be created first. But as we can see, all the views have successfully been created. How can I fix my problem? Please do not hesitate to ask for more specific information.</p>