Created
July 2, 2013 14:51
-
-
Save scalone/5909958 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def onCreate(bundle) | |
super | |
@handler = Handler.new; | |
@i = 0 | |
@thread = Thread.new do | |
@i += 1 | |
puts "#{@i}" | |
@handler.postDelayed(self, 1000) | |
#or @handler.postDelayed(@thread, 1000) | |
end | |
end | |
def onResume | |
super | |
@handler.removeCallbacks(@thread); | |
@handler.postDelayed(@thread, 0); | |
end | |
def onPause | |
super | |
@handler.removeCallbacks(@thread); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment