Custom timeout for a method - Android -
in android app, i'm using method tries user's current location in custom java class. set timeout that, when expires, can whatever want. want timeout cancelable.
how can in simple way?
thanks
you can in many ways
thread.sleep() (on background thread, please)
you have many options, depends on how want implement , need. there many examples , tutorials each on google , so.
countdowntimer
sounds pretty because can set time in millis
, want in onfinish()
work.
Comments
Post a Comment