de1337ed
de1337ed

Reputation: 3325

beginner android development question

I was following a tutorial on youtube, and I was trying to put a background image and I keep having an error in eclipse. I placed the image in the drawable-hdpi folder. Then in the xml, I have:

LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/background_test.png"

But, it keeps saying that it can't find the image. I don't know what I'm doing wrong. Please help. Thank you.

Upvotes: 0

Views: 111

Answers (3)

Adi
Adi

Reputation: 13

you have to use only lowercase letters without any special charaters when u name the image.

Upvotes: 0

sealz
sealz

Reputation: 5408

You can just reference it like you did but without .png. also are you closing your linear layout?

Upvotes: 2

Alex Gitelman
Alex Gitelman

Reputation: 24732

Just remove `.png'

android:background="@drawable/background_test"

Upvotes: 3

Related Questions