How to keep a service alive using AlarmManager.setInexactRepeating()?
问题 I have some existing code that spawns a service intent which does a bunch of stuff in the background. This code does work... Intent serviceIntent = new Intent(context, APMService.class); serviceIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startService(serviceIntent); My question is: how to change this to use the AlarmManager.setInexactRepeating(...) methods? I have changed the above code to this: Intent serviceIntent = new Intent(context, APMService.class); serviceIntent.putExtra(