Cancelling Runnable
<p>I eventually managed to get my other post sorted; to create a way to update the GUI every second or so. So my runnable runs fine but now I've added a button to the GUI which is meant to stop the runnable. But how do you do it?</p>

<p>I've tried this code:</p>

<pre><code> // Button to stop the runnable
    stop = ( Button ) findViewById( R.id.stop );
    stop.setOnClickListener( new View.OnClickListener() 
    {
        @Override
        public void onClick(View v) 
        {
            handler.removeCallbacksAndMessages( timerTask.class );

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

<p>I implement Runnable in order to use it, therefore I don't create a new Thread manually and add a run() method to it. So how do you do it? </p>

<p>Thanks</p>
