Cancel an OnTouchListener on elapsed time
<pre><code>    image.setOnTouchListener(new OnTouchListener() {

             @Override
             public boolean onTouch(View arg0, MotionEvent arg1) {   
                String serverResponse = "";
                JSONObject responseToJSON = null;
                    try {
                        //if we have Internet connection
                        if(NetworkRequest.hasNetworkConnection(MyActivity.this)){
                            //download the server response
                            serverResponse = NetworkRequest.getUrlData(array.get(i));
                            responseToJSON = new JSONObject(serverResponse);
                            String individualDescription = responseToJSON.getString("Description");                 
                        }

                    } catch (Exception e) {
                         e.printStackTrace();
                    }

                 return false;
             } 
    });
</code></pre>

<p>I have the aforementioned code. Where I set an OnClickListener on an image. So, when I will click on the image i override the onTouch method. Then I check if I have internet connection. If I have I try to download a content from the internet. That I want to do is to have something as a Timer and check if  the following line of code</p>

<pre><code>NetworkRequest.getUrlData(array.get(i))
</code></pre>

<p>needs more than 2 seconds to download the content. If needs more that 2 seconds to download the content, I want to cancel both downloading and the OnTouchListener. Is this possible? Any ideas?</p>
