title: Double Clicking event on Android's Screen
body: <p>I am new to Android. Actually whenever I make double click on android screen(layout), I want to create a <code>Toast</code>.But whenever I make a double click on screen nothing happens. Please solve my problem.</p>
  
  <pre><code>public class MainActivity extends Activity implements OnDoubleTapListener,OnGestureListener{
  
     int clickCount = 0;
     long startTime;
     long duration;
     static final int MAX_DURATION = 500;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      GestureDetector detector = new GestureDetector(this,this);
      detector.setOnDoubleTapListener(new OnDoubleTapListener() {
  
          @Override
          public boolean onSingleTapConfirmed(MotionEvent e) {
              if(e.getAction()==1)
              {
              Toast.makeText(getBaseContext(), "onSingleTapConfirmed", Toast.LENGTH_LONG).show();
              }
          return true;
          }
  
          @Override
          public boolean onDoubleTapEvent(MotionEvent e) {
              if(e.getAction()==1)
              {
              Toast.makeText(getBaseContext(), "onDoubleTapEvent", Toast.LENGTH_LONG).show();
              }
              return true;
          }
  
          @Override
          public boolean onDoubleTap(MotionEvent e) {
              if(e.getAction()==1)
              {
              Toast.makeText(getBaseContext(), "onDoubleTap", Toast.LENGTH_LONG).show();
              }
              return true;
          }
      });
  
  }
  </code></pre>