Intent with Countdown crashes android app -


my android app crashes when reaches countdown 0. below part of code related it.

final countdowntimer countdown=new countdowntimer(60000, 1000){           public void ontick(long millisuntilfinished)           {              tvtime.settext((millisuntilfinished / 1000)+"'s");          }           public void onfinish()          {              try{                   tvtime.settext("time over");                  this.cancel();                  toast.maketext(getapplicationcontext(),"answer: "+ originalword, toast.length_long).show();                                  intent i=new intent(lastjumble.this,scorecard.class);                  i.putextra("username",username);                  i.putextra("totalques", totalques);                  i.putextra("count", count);                  startactivity(i);                              }              catch (exception e) {                 // todo: handle exception             }        } }.start(); 

this.cancel() try cancel countdowntimer. since timer finished break. if mean call cancel method in outer class should reference outerclass.this.cancel() outerclass name of class.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -