title: android: how to disable all clicks on a view
body: <p>I am trying to set all the properties of a view in a listview row that will react to clicks (it can be a simple press, a long click or anything else). I tried to set both parent and child views' .setFocusable, .setFocusableInTouchMode, .setLongClickable, .setClickable, .setPressed, .setSelected, .setHapticFeedbackEnabled attributes to false but it did not help.</p>
  
  <p>I am switching between two states of a listview with a button click. When I switch to second state I would like to disable all the clicks on the rows. I am populating the each state of listview with different custom cursoradapters. The following code snippet is from my second cursoradapter for second state:</p>
  
  <pre><code>@Override
  public void bindView(View view, Context context, Cursor cursor) {
      RelativeLayout parent = (RelativeLayout) view.findViewById(R.id.title_rows_relativelayout);
      TextView lists_text = (TextView) view.findViewById(R.id.list_title_text);
      lists_text.setText(cursor.getString(cursor.getColumnIndex(ListsDbAdapter.TITLE)));
      lists_text.setBackgroundResource(R.drawable.background_for_rows);
      parent.setBackgroundResource(R.drawable.background_for_rows);
  
      view.setFocusable(false);
      view.setFocusableInTouchMode(false);
      view.setHapticFeedbackEnabled(false);
      view.setLongClickable(false);
      view.setClickable(false);
      view.setPressed(false);
      view.setSelected(false);
  
      parent.setFocusable(false);
      parent.setFocusableInTouchMode(false);
      parent.setHapticFeedbackEnabled(false);
      parent.setLongClickable(false);
      parent.setClickable(false);
      parent.setPressed(false);
      parent.setSelected(false);
  
      lists_text.setFocusable(false);
      lists_text.setFocusableInTouchMode(false);
      lists_text.setHapticFeedbackEnabled(false);
      lists_text.setLongClickable(false);
      lists_text.setClickable(false);
      lists_text.setPressed(false);
      lists_text.setSelected(false);
  }
  </code></pre>
  
  <p>Thank you in advance.</p>