Android - Stopwatch not working
<p>I've written a stopwatch app, but I altered something earlier which I can't remember and it's suddenly stopped working. It's meant to start when you click, and then pause when you click again, while resetting if you long click, but at the moment it's just restarting. Any help would be appreciated!</p>

<pre><code>public void startTimer(View view) {
        if(isRunning) {
            stopped=true;
            isRunning=false;
        mHandler.removeCallbacks(startClick);
    }
    else {
        if(stopped){
            startTime = System.currentTimeMillis() - elapsedTime;
            TextView t = (TextView)findViewById(R.id.time);
            t.setOnLongClickListener(new Reset());
        }
        else {
            startTime = System.currentTimeMillis();
        }
        mHandler.removeCallbacks(startClick);
        mHandler.postDelayed(startClick, 0);
    }
}

public class Reset implements OnLongClickListener {
    @Override
    public boolean onLongClick(View t) {
        isRunning=true;
        ((TextView)findViewById(R.id.time)).setText("00:00:00");
        startTime = System.currentTimeMillis();
        return false;
    }
}
</code></pre>

<p>EDIT: Sorted. Forgot to put isRunning=true after the else().</p>
