Wednesday, 14 June 2017

How to change Background Color in Android

How-to-change-Background-Color-in-Android-gif



Changing the background color of the Layout or screen in android is very simple to do.

Open a New Project in Android Eclipse

new-android-application

Enter the Project Name For Ex:  BackgroundColor

android-project-name

and click Next till the Finish comes and also click Finish.

The new Project will be created

new-android-project

Click the activity_main.xml below this image to open the xml file.

activity-main-xml

Add the following line inside the Relative layout tag

 android:background="#EACC00"

How-to-change-Background-Color-in-Android-code

Then save the file and open the Graphics Layout you can see the background color has been changed.

How-to-change-Background-Color-in-Android-output

The #EAAC00 is HTML color code , you get more colors from the internet.

You can choose your desired background colors for your android app.

Also Read:

How to change Button color in Android