In my app, I want a media file to play, and to keep playing if the user rotates the screen (destroying the Activity), but I want it to stop playing if the user moves to a differ
You can try listening for the ACTION_CONFIGURATION_CHANGED intent and setting an internal flag indicating the pause is from a configuration change.
I'm not sure if you will receive the intent in time or that you will be guaranteed it will arrive in time as it is probably asynchronous. Might be worth a try though.