Android deleted the application from the recent task list. The Service did not stop and the music stopped, but the music can play normally by pressing the return key. What is the reason?

  android, question

Why did you use the startforeground method to play normally when you recently cleared the application from the list? I did not write this method and the service did not destroy. Why did the music stop?