Reputation: 3
I have coded an automatic messaging application in android. It sends messages automatically at a user specified date and time, including repetition and time interval. But the problem I am facing is that since I have used threads for sleeping upto the specified time my app screen goes blank while the threads are in sleeping state. Please suggest how to deal with that???
Upvotes: 0
Views: 74
Reputation: 2933
If the app sends messages at user specified time and date, i would suggest using AlarmManager and Service to do the job instead of having Threads that sleep. This way your app doesnt have to be "visibly" running to the user to do the "cron" job.
Upvotes: 1