title: Android ListView how to disable multi click
body: <p>I have a listview that contains a textview and a delete imagebutton for each row in the list.  I populated this listview using a custom adapter and overriding the getView method.  However, I also assigned onClick listeners to each textview to open up a dialog for editing the text (as well as the imagebutton for deleting that row in the listview.)</p>
  
  <p>My problem is when the user "accidentally" clicks on two rows using two fingers at the same time, it pops up two dialogs, one is hidden behind the other.  The user can simply dismiss both, but I'd like to avoid this glitch by not making it happen at all.</p>
  
  <p>Here's the code from getView:</p>
  
  <pre><code>@Override
  public View getView(int position, View convertView, ViewGroup parent) {
      ListItem li = getItem(position);    
      ViewHolder viewHolder;
      if(convertView == null) {
          viewHolder = new ViewHolder(); 
          convertView = LayoutInflater.from(getContext()).inflate(R.layout.pref_sqlite_table_row, parent, false);
          viewHolder.imageButton = (ImageButton) convertView.findViewById(R.id.pref_remove_button);
          viewHolder.textView = (TextView) convertView.findViewById(R.id.pref_text_view);
          //we need to update adapter once we finish with editing
          convertView.setTag(viewHolder);
      }
      else {
          viewHolder = (ViewHolder) convertView.getTag();
      }
  
      viewHolder.imageButton.setTag(li.getId());
      // imageButton onClick to remove row
  
      viewHolder.textView.setText(li.getData());
      viewHolder.textView.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
              TextView tv = (TextView) v;
              AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
              View vw = ((Activity) mContext).getLayoutInflater().inflate(R.layout.pref_sqlite_table_dialog, null);
              mNewChangeDialogEditText = (EditText) vw.findViewById(R.id.pref_edit_text);
              mNewChangeDialogEditText.setText(tv.getText());
  
              ImageButton ib = (ImageButton) vw.findViewById(R.id.pref_accept_button);
              ib.setOnClickListener(new OnClickListener() {
                  @Override
                  public void onClick(View v) {
                      // update data
                      mNewChangeDialog.dismiss();
                  }
              });
              builder.setView(vw);
              mNewChangeDialog = builder.create();
              mNewChangeDialog.show();
          }
      });
      return convertView;
  }
  </code></pre>