After I added the method setRetainInstance(true); i started having problems with the app.
So in the portrait mode when I push the button the sound is being played. When I change rotation of the screen, the sound stops and when I push the button again it does not work, the sound is not played.
Oh I found the reason. I have overidden by mistake the method onDestroyView() instead of onDestroy() and that why the app behaved like that.