title: How to Handle Touch Event to pull down the text view
body: <p>I've the following code and I want to generate event when I pull down the textView.
  but my code generate events every time when I touch the screen.</p>
  
  <pre><code>final TextView pullDown=(TextView)findViewById(R.id.textView2);
  
               pullDown.setOnTouchListener(new View.OnTouchListener() {
          @Override
          public boolean onTouch(View v, MotionEvent event) {
  
  
              if (event.getAction() == MotionEvent.ACTION_DOWN){
  
                  first.setBackgroundColor(Color.WHITE);
                  pullDown.setHeight(200);
                  pullDown.setText("Loading");
                  try {
                      Thread.sleep(1000);
                  } catch (InterruptedException e) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                  }
  
  
              }
              else if(event.getAction()==android.view.MotionEvent.ACTION_UP){
                  first.setBackgroundColor(Color.BLUE);
                  change.setText("OK");
                  pullDown.setText("Pull Down to Refresh");
                  pullDown.setHeight(70);
              }
  
                  return true;
          }
  
      });`
  </code></pre>