Open Fr4nKB opened 1 month ago
I'm not an expert, but does your application start automatically when the smartphone starts and does the listening service also start a that time?
Yes, a NotificationListenerService starts automatically at boot without using any BroadcastReceiver. Using some logging I can confirm that the code I posted above is reached but the Glyphs don't turn on.
I narrowed it down to profileInstalled
file in the app's file
directory, eliminating that and restarting the app makes it works (a simple restart won't work)
Perfect, so I think we can mark this issue as closed?
For anyone in need for a solution, delay the initialization of the GDK by some seconds
override fun onCreate() {
super.onCreate()
Handler(Looper.getMainLooper()).postDelayed({
init()
val localGM = GlyphManager.getInstance(applicationContext)
localGM?.init(mCallback)
mGM = localGM
}, 3 * 1000)
}
I have a NotificationListenerService and turn on some glpyhs when a notification is received. My code works when the app is installed for the first time but when the phone reboots glyphs won't turn on until I eliminate app data or reinstall the app.
This is part of the code I'm referring to
Any suggestions?