This week's book giveaways are in the Cloud and AI/ML forums. We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line! See this thread and this one for details.
how can I prevent this situation?
I have created a simple app that would play a short mp3 file with pause and stop implemented, everything goes fine when I am still in the main activity that control the MediaPlayer. but when I switch to the child activity and then return to the parent throut the actionbar arrow somthing weared happen, I lose the reference to the MediaPlayer object and when pressing play button the activity playes the mp3 file again while the first one is still playing in background and the my reference variable mp don't reference to the first one created anymore. the problem does not appear when I am using the back button on the smartphone. is there any solution to this problem ?
also I tryed mp.reset() in my stopDua() method in oreder to start the mp3 file from the beginnign but it didn't work !
thanks in advance....
I think you need to look at the Android activity life-cycle to understand how and when the methods in your code are called. The Bundle passed to onCreate can have info about where in the cycle the code is being called.