randheer wrote::(
Hi,
I have a problem. Android is not accepting this line.
android:background="@drawable/blue"
It says---> ERROR Error: No resource found that matches the given name (at 'background' with value '@drawable/
blue').
Please tell me the reason why it is so.
Well, do you have a file called "blue" within /res/drawable? For instance, I wanted to use a picture of my girlfriend as the background (just out of curiosity's sake in learning), so I went about it this way:
Right-click within the Package Explorer frame and select "Import" and then "File System" from "General". In the "From Directory" area, either type or browse to the folder that contains your file (in my case, "tootoo.jpg"). In the right pane of the import dialogue, browse and check off the file to import. In the "Into Folder" area, click "Browse" and target /res/drawable. There should be only legal characters in the filename (a-z, A-Z, and 0-9. No funny punctuation or spaces). Click finish and the file should now have been imported into /res/drawable and can now be found with
Using xml Syntax Highlighting
androd:background="@drawable/tootoo"
Parsed in 0.000 seconds, using
GeSHi 1.0.8.4
However, if you were just trying to make the background blue (as I understand it from your post), the simpler way to do that would be:
Using xml Syntax Highlighting
android:background="#00f"
Parsed in 0.000 seconds, using
GeSHi 1.0.8.4
The background value is set as #rgb using standard hex values (which is to say, 0-f). Using this, you can mix to create any color.
Hope this helped out, good luck.
I, for one, welcome our new robotic overlords.