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!

  • 2
    What is the "action" button? - Enikeyschik

1 answer 1

The question was written according to the customer. I found the emulator 8.0 - the back button works as it should, and the "home" button (the customer called it "action") worked incorrectly through my fault - by pressing the button, the notification service should start, and on Oreo the notification syntax changed. After correcting this item and adding audiofocus to the program, no problems with the program are observed either at 8.1 or 4.2. The question itself has disappeared.