android:background - Change the Background Color of the Layout of an Activity

How to Change the Background Color of the Layout of an Activity

1. Create an Android project, if you don't already have one.

3. Open the main.xml file and add the following highlighted line of code between the <LinearLayout> tags.This will make the background color

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#808080"  >
</LinearLayout>

4. Determine the Hex value for the color you would like and replace the android:background value with your color.

5. Compile and run!

Resources: