In my online radio program, I do the handler of the "Back" button, in which I close the program:
@Override public void onBackPressed() { super.onBackPressed(); this.finish(); } I do not process the "home" button, but there are onStop() handlers in which I start the notification service in a "blind", and onRestart() in which I stop the notification service. Everything works for me on an old phone with API 16, it works on emulators with API 19 and 25. But on the customer’s phone One Plus with Android 8.1, when you press the back button, the program does not stop, but when you press the "action" button, it starts one copy of the program, and the sounds of the programs overlap each other. I specified the android:launchMode="singleTask" arm Oreo emulator in nature (as far as I know) in the manifest of the program, I do not have hardware acceleration to download without arm, and I cannot take the phone from the customer to test. Where to dig, tell me!