0

im using WakefulIntentService and i want to lunch service from doWakefulWork with wake lock, how to do that ? (my service run for 10 second and then calls stopSelf).

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
Jimmy
  • 10,427
  • 18
  • 67
  • 122

1 Answers1

0

Acquire your own WakeLock can call startService(). Be sure to release your WakeLock before your secondary service calls stopSelf().

For something as short as ten seconds, you might just try to put that code in the WakefulIntentService itself. I don't know why it is 10 seconds, but it may be simpler for you to arrange for the background thread to block or something than it will be for you to mess around with your own WakeLock.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491