Well, I'm facing some problems again. First, with the last version, I can't use the companion anymore because of incompatibility and it takes me a long time to compile and install my app every time I want to check something.
And another big problem is that I have 3 different screens : Main, Setup and Player. The problem is that when I close the main screen to switch to the player screen, if I start a play, when I come back to the main screen, then return to the player screen, it is impossible to stop the player... So I tried not to close the player screen and open the main screen from the player when something is playing but when I want to close the App, I return to the player screen...and finaly I can't close the app only with app killer from launcher.
I think that when a play is started, the app should save the process number to be able to close it every time we need to. Actually, I can only stop the player if I stay on the player screen. All is OK if I stop before returning to the main screen but if the player is playing something, after closing the player screen, it is impossible to stop the player because the extension does not store anything when the player is started and all is forgotten when the screen where the player is launched is closed.
Hello Anke. First, many thanks for all you wrote to help me. Second, I need the player to continue playing when switching back to the main screen because people using my app want to remote the "HotSpot" device with the buttons on the main screen while they're listening people talking on an other Network. And the problem is that when the player screen is closed, there is no way to stop the player launched before.
I thought switching to virtual screens with hiding and showing some elements but it is a huge work and definitively not practical to use.
Yes, we know this. So if you want to stop the Player after switching screens, the only way is to start the Player on Screen1 (and only on Screen1). When you then switch to Screen2, you must NOT close Screen1, but when you go back to Screen1 you must simply close Screen2. This way you can stop the Player on Screen1, no matter how many times you switched to other screens before. The latter (stopping Player on Screen1) is basically also possible from other screens using a timer.
The problem is that I can't start the player in the main screen because it is full and the player screen is full too ! The main screen is a remote and the player screen allow to start playing audio stream. When the player is started, the user come back to the main screen then continue to remote a radio device.
I just implemented a floating notification to the Player, where you can Pause, Resume or Stop, I'll be testing it to see if it works well, it could probably be useful for you, the notification is present on any screen you go to, as long as you don't close the application.
Just wait a bit until tomorrow when I get back to the computer.
Thank you very much Joe but I just need to stop the player whatever the screen it has been started even if it is closed with my Stop button on the player screen.
You are trying to stretch the rules and even limitations of android a bit. The screen is an android activity, you can't access a player instance created in one activity from another activity. To achieve this, the player would have to be created in a separate static class or service. Then you can access such a player from any activity.
If you want to easily achieve what you need with a regular player, you need to use virtual screens.
You can also pause playback on the track selection screen while switching screens, then pass the track title and current time of the currently playing track to the next screen to play that title from that point on the new screen. But you may hear a pause while switching.