title: How to disable scrolling in GridView?
body: <p>My application has a GridView. It already has a onItemClickListener and onItemLongClickListener. I would like to disable the scrolling in the GridView now. With the help of <a href="https://stackoverflow.com/a/6496632/985025">https://stackoverflow.com/a/6496632/985025</a> I have added an onTouchListener as shown below:    </p>
  
  <pre><code>        mGridView.setOnItemClickListener(this);  
          mGridView.setOnItemLongClickListener(this);  
          mGridView.setOnTouchListener(new OnTouchListener(){  
              @Override  
              public boolean onTouch(View arg0, MotionEvent arg1) {  
                  if(arg1.getAction() == MotionEvent.ACTION_MOVE)  
                      return true;  
                  else  
                      return false;  
              }  
          });  
  </code></pre>
  
  <p>My expected behavior is that when ever I try to scroll in the GridView, that event should be ignored. But, I get an event in onItemClick even after returning true in onTouch.
  Is there a way to avoid onItemClick in case of scroll on GridView?</p>