I am trying to start a service when my app begins, and I need it the service to restart, incase a user decides to force close the service, even though the app is running(its ok, for him to force close the app, but i need to prevent closing of service while the app is running).
So i went about extending the Application class, and this is what I am doing to start the service...
ServiceConnection conn = new ServiceConnection() {
public void onServiceConnected(ComponentName className, IBinder service) {
Log.d("start","ok");
}
public void onServiceDisconnected(ComponentName className) {
}
};
bindService(new Intent(this,DueService.class), conn, 0);
This, however, does not start the service. Though, using startService seems to work. Any ideas?