Ceelos
Ceelos

Reputation: 1126

ImageView image not showing on Eclipse + Android

I have all my pictures saved in the drawable-xhdpi folder. I have a total of six images, it shows 4 but not the last two despite me using the same code for both in the xml file.

 <ImageView
            android:id="@+id/button4"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_above="@+id/textView4"
            android:layout_alignRight="@+id/textView4"
            android:onClick="food"
            android:src="@drawable/foods" /> 

^ That one is viewable

<ImageView
            android:id="@+id/button6"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_alignBaseline="@+id/button5"
            android:layout_alignBottom="@+id/button5"
            android:layout_alignRight="@+id/textView4"
            android:onClick="parking"
            android:src="@drawable/parking" />

^ This one isn't.

This is what I get when viewing through Graphical Layout

The following classes could not be found:
- ImageView (Change to android.widget.ImageView, Fix Build Path, Edit XML)

Again, both images are contained within the same folder. It might be obvious, I'm relatively new to android.

Upvotes: 1

Views: 2014

Answers (2)

Sagar Thakarar
Sagar Thakarar

Reputation: 271

i faced same problem , if you are using image saved .icon extension it may cause this problem. change your image type. hope this help.

Upvotes: 0

kabuto178
kabuto178

Reputation: 3167

Go to Project -> Clean... from the top bar in eclipse. Then a good old restart of the graphical view might help as well.

Upvotes: 1

Related Questions