Reputation: 8626
I wanted to put background image to my app.
I kept image in res>drawable-hdpi folder.
Seted my image view as:
<LinearLayout
android:id="@+id/tv_un"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10pt"
android:textColor="#444444"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="res/drawable-hdpi/capture.PNG"/>
But its giving me error in the form of tooltip on line:
error: Error: String types not allowed (at 'src' with value 'res/drawable-hdpi/capture.PNG').
Am i pasting image in wrong folder?
Or code is wrong??
Please help me.
Upvotes: 0
Views: 910
Reputation: 18933
change
android:src="res/drawable-hdpi/capture.PNG"
with
android:src="@drawable/capture"
Upvotes: 1
Reputation: 28823
Replace
android:src="res/drawable-hdpi/capture.PNG"
with
android:src="@drawable/capture"
Hope it helps.
Upvotes: 1
Reputation: 7092
try this, put capture.png in any drawable folder
android:src="@drawable/capture"
Upvotes: 2