+ 1
Android beginner question
why is my stopwatch not running? private void runTimer(){ final TextView timeView=(TextView)findViewById(R.id.time_view); final Handler handler=new Handler(); handler.post(new Runnable(){ @Override public void run(){ int hours=seconds/3600; int minutes=(seconds%3600)/60; int secs=seconds%60; String time=String.format("%d:%2d:%02d",hours,minutes,secs); timeView.setText(time); if(running){ seconds++; } } }); }}
1 Answer
- 1
int seconds = 60;