Android Motionevent overlay
<p>Hello so im making a android app and it uses geolocation/Google maps, there are no buttons on the map/the app except a tab host. so I need it so if a user taps for 1500 ms then a dialog comes up, so far nothing happens but I get no errors here's my code thanks in advance</p>

<pre><code>   class Touchy extends Overlay{
    public boolean ontouchevent(MotionEvent e, MapView m){
        if (e.getAction() == MotionEvent.ACTION_DOWN){
            start = e.getEventTime();
        }
        if (e.getAction() == MotionEvent.ACTION_UP){
            stop = e.getEventTime();
        }
         if (stop - start &gt; 1500){
            AlertDialog alert = new           AlertDialog.Builder(SPtouch2fixActivity.this).create();
             alert.setTitle("Alert");  
             alert.setMessage("This is an alert");  
             alert.setButton("OK", new   DialogInterface.OnClickListener() {  

                public void onClick(DialogInterface dialog, int  which) {
                    // TODO Auto-generated method stub

                }
            });
            alert.setButton2("Update Geolocation", new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    // TODO Auto-generated method stub

                }
            });
           alert.setButton3("cancel", new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int which) {
                    // TODO Auto-generated method stub

                }

            });
            alert.show();
            return true;
        }

        return false;
    }

}
</code></pre>

<p>}</p>
