Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid App Background Colour Not Setting
    primarykey
    data
    text
    <p>I've recently started working on an Android app. I'm not a programming noob, I have been programming in Java since 2009, but this is my first Android app. I have tried following some tutorials on how to set the background colour but it simply isn't working for me. I can't work out what I'm doing wrong.</p> <p>In my layout directory I have files called: main.xml and view_fact.xml. They both use the linear layout and my LinearLayout Tag is as follows:</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/background_grey" &gt; </code></pre> <p>And in my "values" directory I the contents of "strings.xml" is:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;resources&gt; &lt;string name="app_name"&gt;Facts&lt;/string&gt; &lt;color name="background_grey"&gt;#E8E8E8&lt;/color&gt; &lt;/resources&gt; </code></pre> <p>But the background colour is not changing from the default black.</p> <p>I've also tried adding: "android:theme="@android:style/Theme.Light"" in my AndroidManifest.xml file.</p> <p>None of this is working, any suggestions?</p> <p>Thank you.</p> <p>On my view_fact.xml page it looks like this:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/background_grey" &gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Fact:" android:padding="10dp" android:textColor="#080808" /&gt; &lt;TextView android:id="@+id/factData" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="10dp" android:text="" /&gt; &lt;Button android:id="@+id/anotherFactButton" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Another Fact"/&gt; &lt;/LinearLayout&gt; </code></pre> <p>What's interesting is that the text in "factData" is grey, while the text: "Fact:" in the Text View above is white, and I've tried to change it's colour to red and it doesn't work. It stays white.</p> <p>Any suggestions? I still haven't managed to get this working; thank you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload