As per CommonsWare, I just need to override onStartCommand()
with START_NOT_STICKY
which will make my service loosly tight with Android and won't start once it's killed by TaskManager
. That's what behaviour expected from that running Service
.
Code Snippet:
public class UploadData extends Service
{
...
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
// TODO Auto-generated method stub
super.onStartCommand(intent, flags, startId);
return START_NOT_STICKY;
}
}