Android - ImageView - Black Images on Galaxy Tab 2

222 Views Asked by At

My application is working fine on every single device except on the Galaxy Tab 2.

This is how it looks on the Galaxy Tab 2:

enter image description here

I have tried every single solution and it's still the same ;/.

imageView.setImageResource(songsList.get(position).getIconId()); <--- I am adding the right resource id here and it shows a black image.

I even duplicated my graphic to the hdpi/xhdpi/xxhdpi/xxhdpi folders and it's all the same.

Anyone have an idea on what's wrong here? ;s

My Adapter:

@Override
public View getView(int position, View view, ViewGroup parent) {
    if (view == null) {
        LayoutInflater inflater = (LayoutInflater) context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);

        view = inflater.inflate(R.layout.view_row, parent, false);
    }

    imageView = (ImageView) view.findViewById(R.id.list_image);
    imageView.setImageResource(songsList.get(position).getIconId());

    Log.i("SongBox", "" + songsList.get(position).getIconId());

    return view;
}

view_row:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="150dp"
    android:background="@android:drawable/dialog_holo_light_frame"
    android:orientation="vertical"
    android:padding="5dp">

    <ImageView
        android:id="@+id/list_image"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:adjustViewBounds="true"
        android:contentDescription="@string/desc"
        android:scaleType="centerCrop" />

    <RelativeLayout
        android:id="@+id/rowRL"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <TextView
            android:id="@+id/list_text"
            style="@style/UiTextView"
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:layout_alignParentBottom="true"
            android:background="#90FAEBD7"
            android:gravity="center"
            android:textSize="22sp" />

        <ImageView
            android:id="@+id/list_lock"
            android:layout_width="70dp"
            android:layout_height="wrap_content"
            android:layout_above="@+id/list_text"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:layout_margin="5dp"
            android:src="@drawable/icon_lock_glow" />
    </RelativeLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/border" />
</FrameLayout>

SongsRepository(This is how I'm getting the ids):

public class Songs {

    public List<ISong> toList() {
        return Arrays.asList(
                new Song1(),
                new Song2(),
                new Song3(),
                new Song4(),
                new Song5(),
                new Song6(),
                new Song7(),
                new Song8(),
                new Song9(),
                new Song10(),
                new Song11(),
                new Song12(),
                new Song13(),
                new Song14(),
                new Song15(),
                new Song16(),
                new Song17(),
                new Song18(),
                new Song19(),
                new Song20());
    }

    public ISong getSong(int listPosition) {
        return toList().get(listPosition);
    }
}

and an example of the Song class:

public class Song4 implements ISong {

    @Override
    public boolean isUnlocked() {
        return true;
    }

    @Override
    public int getNameId() {
        return R.string.song_4;
    }

    @Override
    public int getRawId() {
        return R.raw.song4;
    }

    @Override
    public int getIconId() {
        return R.drawable.box_song4;
    }

    @Override
    public int getBackgroundId() {
        return R.drawable.background_song4;
    }
}
0

There are 0 best solutions below