android - Having trouble creating a stopwatch timer with Calendar class -
android - Having trouble creating a stopwatch timer with Calendar class -
i have been having little problem using calendar class create stopwatch timer. reason, programme keeps crashing when piece of code called. tried using other classes such timer & date, same thing happened. code follows:
private onclicklistener clearbuttonlistener = new onclicklistener() { public void onclick(view v) { calendar.set(calendar.hour, 0); calendar.set(calendar.minute, 0); calendar.set(calendar.second, 0); calendar.set(calendar.millisecond, 0); fulltime = calendar.hour + ":" + calendar.minute + ":" + calendar.second + ":" + calendar.millisecond; timetextview.settext(fulltime); } };
should utilize class (other stopwatch class) prepare problem? bunch.
please not vote downwards on post. if post unclear in way, please express concern in comments section. give thanks you.
have initialised "calender" or "timetextview"? maybe can post exception first. initialise calender phone call calendar.getinstance();
android timer stopwatch
Comments
Post a Comment