The Android theme is set to black, but it is white in Android 4.1

I tried both Theme.DeviceDefault and Theme.Black in my styles.xml and both make my emulator 2.1 correctly black, but on emulator 4.1 it remains white ... Am I doing something wrong?

 <resources> <style name="AppTheme" parent="android:Theme.Black" /> </resources> 

PS: I assume that the Subject drop-down list at the top of the graphic layout just shows me how it will look, is this not some kind of setting that is going somewhere (for the application)?

+4
source share
4 answers

Android always selects the most special values ​​folder that best suits your device.

As an example, if you have a values folder and another values-v14 folder, the Android system takes resources from the latter if the device is v14 or newer.

See the documentation for Android for more information.

+8
source

1.prepare a new folder under res → values-v13
2.Create a file style and add this style:
<style name="AppTheme" parent="android:style/Theme.Holo.Light">

in your manifest use this style for your application like this

 <application android:name=".MainApp" android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/AppTheme" > 

So in the ICS version you use the Holo.light theme and pre ICS use the default you created

+3
source

Setting it up with styles doesn't actually work, but if you install it explicitly for the application, it works.

 <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@android:style/Theme.Black" > 
+1
source

By default, 4.0 and 4.1 give us a white background, but you can change it to black. I am facing the same problem a few days ago, if your project theme is set to black, maybe you change the name by creating the project to “Main”, by default its “MainActivity”, but if you change it to “Main”, it will give you black backgrount /

I don’t know if my answer relates to your question or not, but I think you are talking about it if I’m not mistaken.

0
source

Source: https://habr.com/ru/post/1432425/


All Articles