androidandroid-manifestandroid-theme

"Possible overdraw: Root element paints background "


While running Android Lint on my Project I came across this warning

Possible overdraw: Root element paints background @drawable/main with a theme that also paints a background

Where inferred theme is @android:style/Theme.NoTitleBar.Fullscreen

Can someone explain to me why is this coming and how to remove it ??

My xml:

  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="@drawable/main" //***LINT warning***
        android:orientation="vertical"
        android:weightSum="3" >

The part of manifest where theme is defined

 <application
        android:icon="@drawable/ic_logo"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >

Solution

  • To optimize your apps performance (avoid overdraw), you can do the following: