I want to change the background of my App's Activity.
Now that is available in black I want to change that with some images or themes.
Add a android:theme="@style/Theme.AppTheme
attribute to your application tag in the manifest file with the theme you want to use. This will prevent the default "black" background to be drawn if you only set a background in your Activity/Fragment layout file.
You declared it in a style.xml file.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="@style/Theme">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
<item name="android:windowBackground">@drawable/custom_background</item>
</style>
</resources>
AndroidManifest.xml file
...
<application
android:name="@string/app_name"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.AppTheme">
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With