0

I have a BaseActivity class which is inherited from other Activities. This is the onResume in BaseActivity class.

@Override
    protected void onResume() {
        super.onResume();
        if (!CustomSystem.isUpdateServiceStarted()) {
            UpdateService.started = false;
            startService(new Intent(this, UpdateService.class));
            timerCheckStarted = new CountDownTimer(500, 500) {
                ...
            };
            timerCheckStarted.start();
        } else {
            UpdateService.wakeUp(BaseActivity.this);
        }
    }

On my firebase page, I see that an BackgroundServiceStartNotAllowedException is thrown only in Android 12 and 13.

I imagine that is linked to the restrictions introduced from android 12 , but I can’t figure which is the problem.

giordy16
  • 275
  • 1
  • 12
  • Does this answer your question? [Android 9.0: Not allowed to start service: app is in background.. after onResume()](https://stackoverflow.com/questions/52013545/android-9-0-not-allowed-to-start-service-app-is-in-background-after-onresume) – levi Jul 18 '23 at 13:56

0 Answers0