android time calculator example code (help) -
i little bit confused date formatter/calander , formats related time. trying current time no date and, although have seen several code snippets still confuses me.
problem following current time , send method calculations.
for example
public void oncreate(bundle savedinstancestate){.... ......... ........ **get current time** sendtomethod(currenttime) } public void sendtomethod(currenttime) { date pasttime long diff = currenttime - pasttime; if (diff > 1000) // here want check if diffrence more 10 seconds // }
i searched , tried several codes got lost.
found there alot of ways this, still have no clue how solve this.
please, if can me appreciate lot.
try this:
private long diff, start = system.currenttimemillis(); public void sendtomethod() { diff = system.currenttimemillis() - start; if (diff > 10000) { // difference more 10 seconds // } start = system.currenttimemillis(); }
Comments
Post a Comment