Set Background- Eclipse

  • Replies:2
  • OpenNot stickiedUnanswered

Jul 28, 2012 10:35:41 PM via Website

Hey.. my name is Netanel, Im trying to learn as fast as i can all the develope style..
so im using the eclipse as my develope software..
im trying to setup some background that i made for the application.. im following some online videos that learns how to develope..
i made a .png file for a background.. - in the .xml im puting the command:

android:background="@drawable/splash_background" (the name and the resource are right)
and when im going to the "Graphical Layout" its saying :

"Failed to convert @drawable/splash_background into a drawable
Couldn't resolve resource @drawable/splash_background
Exception details are logged in Window > Show View > Error Log"

so what is the problem? in the guide the said that i need to use PNG file.. i did it.. to set a background i dont have to work with the java right?


Im using windows, eclipse java Juno Win32 (the newest version).

Ty for the help :)

Feb 4, 2013 1:11:38 PM via Website

if everything is right than just clean and build your project.

otherwise when you are setting background just use a trick enter alt and space if any problem than it wouldn;t give you the image.

Feb 28, 2013 4:23:48 PM via Website

create one folder name raw and put image inside this folder
then
in xml file use in main layout e.g.
<Linearlayout

android:background="@raw/bg">
</Linearlayout>