Activities are fundamental components in android. They represent a screen with UI widgets as well as data.

It’s important therefore to know how to customize activities.

Let’s look at some of the simple ways activities can be customized:

Changing Background Color

We can change background color of an activity in the layout xml via the android:background="" element.
All you need to do is add it in the root tag of your layout as below:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=""


Changing Activity Title

The activity title displaye in the ToolBar can be changed programmatically using the Title property defined in the Android.App.Acrivity.

public string Title { get; set; }
&lt;pre&gt;&lt;code&gt;You can both get and set the color. Let's see how to set it:

    public class MainActivity : Activity
        protected override void OnCreate(Bundle bundle)
             SetContentView (Resource.Layout.Main);

            //here's the custom title
            this.Title = "My Custom Title";

Categorized in: