Unable to change background color in android xml file -


whenever trying change background color using

  <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@android:color/somecolor"> 

am getting error:

failed parse file e:\adt\sdk\platforms\android-18\data\res\color\somecolor.xml 

i have cleared project , restarted several times have been unsuccessful in getting rid of error.

try this:

 <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@color/somecolor"> 

edit

and make sure set color properly. should set in strings.xml.

<color name="somecolor">#ffff0000</color>

or can set

android:background="#dcdcdc" // give appropriate color code here. 

hope helps .. :)


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -