• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Best way to schedule a task for long time ?

 
Bd Coder
Greenhorn
Posts: 2
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I want to develop a project which schedule some task by users. ( E.g. User select date and time by Datepicker and Timepicker and save )
At first i tried it by Service . But it didn't work.
Some people tell me to use Broadcast Receiver for it . But i can't find any way by using Broadcast Receiver.
can anyone help me to solve this ?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might use the AlarmManager to set a trigger defined by a PendingIntent.
 
Bd Coder
Greenhorn
Posts: 2
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using AlarmManager, I can't get users preference time and date by Datepicker and Timepicker. We can use specific time (in secends which is defined in code) for start the work.
E.g. http://techblogon.com/simple-android-alarmmanager-example-to-schedule-an-event/
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not? What has getting the user settings to do with how the alarm is set?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic