added onResume and onPause method to each activity to handle music playing