title: Android Button isPressed
body: <p>I am using "onTouchListener" in Android for a Button. </p>
  
  <p>B.setOnTouchListener(</p>
  
  <pre><code>            new OnTouchListener() {
                  @Override
                  public boolean onTouch(View v, MotionEvent event) {
                      Log.d(G.AN,"ButtonID: "+B.getId());
                      mEvent = event.getAction(); 
                      Log.d(G.AN,"Event: " + mEvent);
                          H.post(RN);
                          return false;
                  }
              }
          );
  </code></pre>
  
  <p>"RN" is a runnable where I want to check at regular intervals if the button is still pressed. However, when I use isPressed() function, it always returns me "false"</p>
  
  <pre><code>@Override public void run() {
              Log.d(G.AN,"ButtonID: "+B.getId());
              switch(mEvent) {
  
  
              case MotionEvent.ACTION_UP:
                  H.removeCallbacks(RN);
                  break;
  
              case MotionEvent.ACTION_DOWN:
                  Delay = 300;
  
              default:
                  **if(!B.isPressed())** {
                      Log.d(G.AN,"Button is not pressed");
                      return;
                  }
                  if(!IsIndex) { ........................
  </code></pre>
  
  <p>Does isPressed function really work? Any androiders out there who used it this way?</p>
  
  <p>Thanks in advance...</p>