I build an application that collects data about the battery. In order to collect this data I need my application to run on the background in order to be able to collect this
- @Override public int onStartCommand(Intent intent, int flags, int
startId) {
handleCommand(intent);
// We want this service to continue running until it is explicitly
// stopped, so return sticky.
return START_STICKY; }