I really appreciate if someone can help me with using how to use shape drawable as my background xml for my view.
This is what I tried: But I never get the color. An
You have wrong color settings, you must specify 4 byte colors, eg: #ffff8080
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#f0600000"/>
<stroke android:width="3dp" android:color="#ffff8080"/>
<corners android:radius="3dp" />
<padding android:left="10dp" android:top="10dp"
android:right="10dp" android:bottom="10dp" />
</shape>
try this
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<corners
android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"
android:radius="0.1dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp" />
<solid android:color="#Efffff" />
<stroke
android:width="2dp"
android:color="#25aaff" />
</shape>
OK - I'm pretty sure my problem is the same as what drove your question, and that I've found its cause.
The problem is conflicting resource definitions (specifically, resource filenames). Say, for example, for some reason you put a file named "drawable_bg.png" in /res/color/ in your project; and forgot that you did this (or it happened accidentally). If you then try to define a Shape Drawable in your project named "res/drawable/dialog_bg.xml" - the PNG (from 'MyLib') takes precedence. Since you can have many "res" folders for different DPI, form-factor, SDK, etc - it's fairly easy to wind up with a filename collision. This can also happen with Android Library projects. If your project has any dependencies on projects which themselves have resources, they can cause conflicts. As I just found today, Eclipse can either hide or fail to show a warning about this in many situations.
When this happens it can easily appear that the Shape Drawable is not applied. Since "dialog_bg.png" probably isn't designed for your view you get unexpected results and it's easy to be confused about what's really going on.
The easiest way to solve this is to rename the shape drawable in your project. If the problem is with a resource(s) in an Android Library Project, then there may be a better solution found by applying the recommended practice as described at http://tools.android.com/recent/buildchangesinrevision14.
It seems like there are a couple of problems here. The biggest one seems to be the idea that you can use a shape as a text color and that doesn't seem to make sense. You can use a color as a background of a shape, and you can set a shape as the background of view but you can't set a shape as text background or foreground.
The other thing that looks wrong is that in the alternative XML files that you tried, the end quotes around the color values are missing, so that shouldn't compile at all.
You are giving a wrong hexa color attribue. It should be eight digits after #. e.g #00000000