Skip to content
Advertisement

App crashes due to bad notification for startforeground

i have been working on night filter app but i stuck with sdk version. My app is perfectly working on device whose sdk version is less then 23 but above 23 is not working it’s like when i tested my app in my Xiaomi which has android 9 app crashes and when i track the logcat error will through stating Bad Notification For StartForeGround. see this logcat message

JavaScript

This is my Service activity

JavaScript

I have using remoteviews to show notification and manipulate there only like music player but the problem is how to tacke this bug. I also use startforeground permission in manifest but same problem app crash. I think there is problem in Notification ID which i set to 9216. so can anyone give me solution for same.

Thanks in Advance!

Advertisement

Answer

I understand the issue. Every source code isn’t compatible with every android device. Something just like your source code. There’s lot of code you wrote. That’s why I can’t re-edit your whole source code. I am just giving a demo. To make compatible notification with android devices.

You can get that repo in my github also.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement