Вопрос

I have kept some .png file in res->drawable-hdpi and now, I want to show it in imageview in android. But when I refer to that image from image view, android says:

Couldn't resolve resource @drawable/my_pic.

I am using the following code :

<ImageView
            android:id="@+id/imageView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/my_pic" />
  1. I am using every file name in small letter
  2. The size of my_pic is 36kb

So how can I load the picture? Is this problem for size or something else. How to fix this problem. Any help ?

Это было полезно?

Решение

If you dont save your changes, you get a

"Couldn't resolve resource @drawable/my_pic."

Control+S ... to save Changes, its all or..

When the R.java have a problem, only needs:

(Project -> Clean from the menus) 
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top