Home > OS >  Singleton Kotlin object method is not getting called, anyone know why?
Singleton Kotlin object method is not getting called, anyone know why?

Time:08-01

please see image attached for the code. Basically, I have a singleton object in android I am trying to call methods on, but in my on receive code, the methods compile, but they wont log their messages in the log, so they are not getting called, or I am missing something. Does anyone know why?code

CodePudding user response:

You shouldn't create an instance of an object. Object is singleton in kotlin.

You must use it like Static class in java like below:

AlarmTone.[your function name]
  • Related