set up preferences in onCreatePreferences instead of onResume so that their visibility is determined before the screen appears rather than after