Last active
October 16, 2019 07:04
-
-
Save 0xtmphey/4823625009277af84d99e8240868c949 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
class Activity { | |
lateinit var notificationManager: NotificationManager | |
override fun onCreate() { | |
super.onCreate() | |
// lateinit allows to access property without initialization and check for null | |
// this will cause a crash | |
notificationManager.readNotification() | |
notificationManager = NotificationManager() | |
// After initialization we can easily access it | |
notificationManager.readNotification() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment