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

Issue

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

Solution

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]

Answered By – Morteza Allahyari

Answer Checked By – Jay B. (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *