android-service

android studio service doesn't work when i clean my app

徘徊边缘 提交于 2020-12-15 01:43:12
问题 I use service to push notification when someone receive message,and my service works well when i open the app and close the app,but when i clean my app,it just stop.Is it the problem that i write my own startForeground instead of using the startForeground they gave?it was work at the beginning,but when i add startMyOwnForeground and Runnable,it doesn't work. Runnable is to connect to my datebase every 2 seconds to check if there is new message,and it will push notification to the user This is

How to show a notification everyday at a certain time even when the app is closed?

*爱你&永不变心* 提交于 2020-11-30 06:45:51
问题 Although this question might have been asked before on Stack Overflow, I still haven't found a clear answer. I want to show a notification everyday at 12pm for example even when the app is closed. I have referenced from those links: Notifications in specific time every day android, Android daily repeating notification at specific time of a day using AlarmManager, Android BroadcastReceiver on startup - keep running when Activity is in Background and much more... I'm confused on the difference