-1

have an Activity extending PreferenceActivity opening like so, PreferenceActivity but when i add a splash screen to the app with:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="android:windowBackground">@drawable/splash_screen_frameup</item>
    <!-- Customize your theme here. -->
</style>

when i navigate to the PreferenceActivity, the toolbar remains but the whole screen is my splash screen (black screen)PreferenceActivity after apptheme background declaration. i have a feeling it is due to the PreferenceActivity not having a declared xml layout? how do i have the splash screen but not have it overlap the PreferenceActivity?

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
DevJZ
  • 100
  • 8
  • Picture didnt load, attempting to edit – DevJZ Sep 06 '18 at 03:15
  • please explain the scenario step by step (adding images would be great) – Sudhanshu Vohra Sep 06 '18 at 03:20
  • I apologize for the unclear post, I was debugging after dinner and drinks. Adding "android:windowBackground" in the style created a splash screen, but in doing so it made 1 out of 4 activities be covered by the splash screen. I wrote more detail in the comment on the answer below. – DevJZ Sep 06 '18 at 20:40

1 Answers1

0

There seems to be high chance that your are using the same theme for PreferenceActivity too!

Reason: windowBackground! Create another theme without windowBackground flag & assign that theme to PreferenceActivity...

If that doesn't work, please elaborate more. :)

Darshan
  • 4,020
  • 2
  • 18
  • 49
  • This worked. Thank you. I created a style w/o windowBackground attribute and set the style for the PreferenceActivity in the manifest. Now the PreferenceActivity can be seen. Why is that though? 4 other activities are not effected. Is it because that PreferenceActivity doesn't have an xml file to manipulate/inflate? The Android framework seems to generate the UI automatically for the PreferenceActivity. – DevJZ Sep 06 '18 at 20:38
  • @JZudell well that's strange that other Activities aren't affected... But you should still create a separate Style for those 4 Activities, just to be on a safer side! :) – Darshan Sep 07 '18 at 05:00