java - Restart Timer after .cancel() -
how can restart timer after called .cancel method ? timer declared in oncreate method.
timer.scheduleatfixedrate(new timertask() { @override public void run() { --standby_zaehler; if(standby_zaehler < 0) { rndm_groesse = stand_by.length; random_zahl = r.nextint(rndm_groesse); speakout(stand_by[random_zahl]); (;;) { standby_zaehler = r.nextint(60); if (standby_zaehler >= 15) break; } } } }, 1000, 1000);
somewhere else call
timer.cancel();
but want start again after cancel dont know how . there way ?
Comments
Post a Comment