Search code examples
android-layoutandroidgalaxy

Black square instead of image


I have problem that on Galaxy S3 some images are replaced by black square. On other devices it's working correctly. Some thoughts what can cause this problem?

enter image description here

EDIT: Some code:

final ImageView subscribe = (ImageView) view.findViewById(R.id.subscribe);
final boolean isSubscribed = isSubscribed();
subscribe.setImageResource(isSubscribed ? R.drawable.star_yellow : R.drawable.star_gray);

Layout:

<ImageView
     android:id="@+id/subscribe"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_alignParentRight="true" 
     android:padding="20dip"
     android:src="@drawable/star_gray"/>

Solution

  • I changed imageview to imagebutton and it works now