Created
November 10, 2015 20:48
-
-
Save jmfayard/4740cba818a998323f9b 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
// Standard android variant of https://gist.github.com/jmfayard/2f7b4e7d29f76f6d4999 | |
open class MyActivity : Activity() { | |
val sdkXYZ : DummyClass | |
val otherFeature: DummyClass | |
override fun onCreate() { | |
super.onCreate() | |
sdkXYZ = DummyClass() | |
otherFeature = DummyClass() | |
hockeySdkStartMonitoring() | |
} | |
override fun onDestroy() { | |
super.onDestroy() | |
hockeySdkStopMonitoring() | |
} | |
override fun onPause() { | |
super.onPause() | |
otherFeature.println("Do this in onPause()") | |
} | |
override fun onResume() { | |
super.onResume() | |
otherFeature.println("Do this in onResume()") | |
} | |
override fun onStart() { | |
super.onStart() | |
sdkXYZ.println("SDK XYZ needs to do something in onStart()") | |
} | |
override fun onStop() { | |
super.onStop() | |
sdkXYZ.println("SDK XYZ needs to do something in onStop()") | |
} | |
private fun hockeySdkStopMonitoring() { | |
println("HockeySdk : start monigoring") | |
} | |
private fun hockeySdkStartMonitoring() { | |
println("HockeySdk : stop monigoring") | |
} | |
} | |
data class DummyClass() { | |
fun println(String s) = println(s) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment