Search code examples
androidscreenpreference

How to hide preference screen behind a second one?


I have two PreferenceScreen . I use the theme android:theme="@android:style/Theme.Light.WallpaperSettings. So when I load the second layout, the first layout can be seen under the second layout.

I want to hide the first preference screen, not remove it. How can I do that?


Solution

  • If you have an onClick or other method that sends you to the second preference screen, in this method you could call:

     setContentView(.R.drawable.black_image);
    

    to change the view of the activity in the background

    also don't forget to reset it when in your onResume();