android - How can I create a preference that changes the background of all activities in the app? -
I am creating an app and I do not know how to select a color in an activity in the app And this app changes the background of all the other activities I'm using Android Studio.
Here is the code from my preferences screen. I would like to know what should be added.
preference xmlns: android = "http://schemas.android.com/apk/res/android" xmlns: tools = "http://schemas.android.com/tools" android : Layout_width = "match_parent" Android: layout_height = "match_parent" android: background = "@color / bkgcolor" Android: paddingBottom = "@ Dimen / activity_vertical_margin" Android: paddingLeft = "@ Dimen / activity_horizontal_margin" Android: paddingRight = "@ Dimen / Activity_horizontal_margin "Android: paddingTop =" @ Dimen / activity_vertical_margin "Devices: Reference =". SetActivity "& gt; & lt; / Preferences screen & gt;
The best approach defines a topic and select one of them.
You must put this line in the element that you want to use the theme
android: theme = "@ style / priority theme" in your file styles. Xml do something like that.
& lt; Style name = "priorityTheme" & gt; & Lt; Item name = "android: windowBackground" & gt; @drawable / background_is & lt; / Item & gt; & Lt; Item name = "Android: Background" & gt; # FFEAEAEA & lt; / Item & gt; & Lt; / Style & gt; p> / html>
Comments
Post a Comment