This is my ServiceConnection:
private ServiceConnection mConnection = new ServiceConnection() {
public void onServiceConnected(ComponentName className, IBinder service) {
Log.i("","onServiceConnected TRUE");
locationService = ((LocationService.ServiceBinder)service).getService();
}
public void onServiceDisconnected(ComponentName className) {
Log.i("","onServiceConnected TRUE DISCONNECT");
locationService = null;
}
};
This is never entered. I call it like this:
void doBindService() {
bindService(new Intent(this, LocationService.class), mConnection, Context.BIND_AUTO_CREATE);
}
From my ApplicationClass onCreate:
Intent i= new Intent(PSLocationCenter.this, LocationService.class);
startService(i);
doBindService();
And I have this in the Manifest:
<service android:name=".services.LocationService" android:enabled="true"/>
Am i trying to bind it wrongly? Why is it not called.