how to implement double click in android
<p>I am doing a project in which i want to display  a particular message on single  touch and another message on double touch using android.How can i implement it.</p>

<p>My sample code is below</p>

<pre><code>if(firstTap){
            thisTime = SystemClock.u`enter code here`ptimeMillis();
            firstTap = false;
        }else{
            prevTime = thisTime;
            thisTime = SystemClock.uptimeMillis();

            //Check that thisTime is greater than prevTime
            //just incase system clock reset to zero
            if(thisTime &gt; prevTime){

                //Check if times are within our max delay
                if((thisTime - prevTime) &lt;= DOUBLE_CLICK_MAX_DELAY){

                    //We have detected a double tap!
                    Toast.makeText(AddLocation.this, "DOUBLE TAP DETECTED!!!", Toast.LENGTH_LONG).show();
                    //PUT YOUR LOGIC HERE!!!!

                }else{
                    //Otherwise Reset firstTap
                    firstTap = true;
                }
            }else{
                firstTap = true;
            }
        }
        return false;
</code></pre>
