Exception: android.app.RemoteServiceException: Bad notification for startForeground

I'm trying to start service, and in both onCreate and onStartCommand on OS version 8 onwards calling the startForground notification. In the android 10 Samsung s9 device I'm getting the below crash, could someone help me to find the cause of the issue?

Stack trace:

Exception: android.app.RemoteServiceException: Bad notification for startForeground
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2188)
   at android.os.Handler.dispatchMessage(Handler.java:107)
   at android.os.Looper.loop(Looper.java:237)
   at android.app.ActivityThread.main(ActivityThread.java:8167)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)


Read more here: https://stackoverflow.com/questions/67398487/exception-android-app-remoteserviceexception-bad-notification-for-startforegro

Content Attribution

This content was originally published by Kaviyarasan M at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: