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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -