Ich benutze diese Art und Weise in meine apps:
Stoppen Service:
mContext.stopService(new Intent(mContext, LocationProviderService.class));
Startservice:
if(!HelperUtils.isMyServiceRunning(LocationProviderService.class, getApplicationContext()))
{
startService(new Intent(this, LocationProviderService.class));
}
isMyServiceRunning Methode:
public static boolean isMyServiceRunning(Class<?> serviceClass,Context mContext) {
ActivityManager manager = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
if (serviceClass.getName().equals(service.service.getClassName())) {
return true;
}
}
return false;
}
Haben Sie versucht, und diese Antwort gesehen: http://stackoverflow.com/questions/13227697/how-to-restart-service-in-android-to-call-service-oncreate- wieder –