Pooya1 Active Member Licensed User Nov 4, 2018 #1 Hi I have 5 service in my app that i stop their when my job finished Also write many code in Starter service Unfortunately android show notification for my app in notification bar and i dont know which service is the reason I use below code after finished my job in service Code: Copy Sleep(0) StopService(Me) Service.StopAutomaticForeground I am sure starter service is not reason or problem because when i disable notification,Starter is working well But i dont know which My attachment picture In this picture when i disable sound,so my app notification dont appear in notification bar
Hi I have 5 service in my app that i stop their when my job finished Also write many code in Starter service Unfortunately android show notification for my app in notification bar and i dont know which service is the reason I use below code after finished my job in service Code: Copy Sleep(0) StopService(Me) Service.StopAutomaticForeground I am sure starter service is not reason or problem because when i disable notification,Starter is working well But i dont know which My attachment picture In this picture when i disable sound,so my app notification dont appear in notification bar
Erel B4X founder Staff member Licensed User Longtime User Nov 5, 2018 #2 Services only enter automatic foreground mode when they are started from a receiver while the app is in the background. You can disable foreground mode in all your services with this line in Service_Create of each of the services: Code: Copy Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_NEVER This will cause the app to crash if won't start foreground mode when needed yourself (on Android 8+). However it will help you find out what happens. Upvote 0
Services only enter automatic foreground mode when they are started from a receiver while the app is in the background. You can disable foreground mode in all your services with this line in Service_Create of each of the services: Code: Copy Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_NEVER This will cause the app to crash if won't start foreground mode when needed yourself (on Android 8+). However it will help you find out what happens.