Android gridview ulega awarii w Galaxy 3

Ok, myślę, że mam prawdziwe pytanie o zmianę. Zaimplementowałem gridView w Androidzie, krok po kroku instrukcje na stronie Android Developers,http://developer.android.com/resources/tutorials/views/hello-gridview.html Zmieniłem go tak, że po kliknięciu widoku mapa bitowa zostanie zwrócona. To wszystko działa doskonale na zaawansowanych telefonach, takich jak Galxy Note i Galaxy S2, a także na mniej zaawansowanych, takich jak Galaxy ace, a nawet jakieś kiepskie htc sprzed 2 lat. Ale z jakiegoś powodu ulega awarii w galaktyce 3 z ICS z powodu problemów z OutOfMemory. Kiedy używasz około połowy obrazów na gridview, działa (choć trochę powoli). Czy to ma jakikolwiek sens?

To jest moja implementacja ImageAdapter:

public class ImageAdapter extends BaseAdapter {
private Context mContext;
private int mWidth;
private int mHeight;

public ImageAdapter(Context c, int width, int height) {
    mContext = c;
    mWidth = width;
    mHeight = height;
}

public int getCount() {
    return mThumbIds.length;
}

public Object getItem(int position) {
    return null;
}

public long getItemId(int position) {
    return mThumbIds[position];
}

// create a new ImageView for each item referenced by the Adapter
public View getView(int position, View convertView, ViewGroup parent) {
    ImageView imageView;
    if (convertView == null) {  // if it's not recycled, initialize some attributes
        imageView = new ImageView(mContext);
        imageView.setLayoutParams(new GridView.LayoutParams(mWidth, mHeight));
        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
        imageView.setPadding(8, 8, 8, 8);
    } else {
        imageView = (ImageView) convertView;
    }

    imageView.setImageResource(mThumbIds[position]);
    return imageView;
}

// references to our images
private Integer[] mThumbIds = {
        R.drawable.third_world , R.drawable.annoyinggirl,
        R.drawable.asianfather, R.drawable.awkawespeng,
        R.drawable.awkpeng, R.drawable.blankdad,
        R.drawable.collegesenior, R.drawable.courage,
        R.drawable.frog, R.drawable.frynotsure,
        R.drawable.goodguygreg, R.drawable.scumbag,
        R.drawable.raptor,R.drawable.keano,
        R.drawable.successkid, R.drawable.wonka,
        R.drawable.braceyourselves, R.drawable.onedoesnotsimply,
        R.drawable.firstworldproblem, R.drawable.amitheonlyone,
        R.drawable.badluckbrian, R.drawable.interestingman,
        R.drawable.toodamnhigh, R.drawable.def    
};

}

To jest funkcja wywołująca z mojej głównej:

  private void changeToTemplateView(){
    setContentView(R.layout.templates);

    GridView gridview = (GridView) findViewById(R.id.gridview);
    gridview.setAdapter(new ImageAdapter(context, (int)(dstWidth * 1.4), (int)(dstHeight * 1.4)));

    gridview.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View v, int position, long id) {

            Options opts = new Options();
            Bitmap bitmap = BitmapFactory.decodeResource(getResources(), (int) parent.getItemIdAtPosition(position), opts);

            //do stuff with bitmap          
        }
    });
}

A to jest plik XML dla gridview:

<?xml version="1.0" encoding="utf-8"?>
<GridView xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/gridview"
android:layout_width="fill_parent" 
android:layout_height="fill_parent"
android:columnWidth="90dp"
android:numColumns="auto_fit"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:stretchMode="columnWidth"
android:gravity="center"

/>

Jeśli ktokolwiek ma jakieś pojęcie o tym, co tutaj robię źle, będę na zawsze wdzięczny

EDYCJA: Przed awarią otrzymuję błąd w dzienniku: „FimgApiStretch: stretch failed”. Ponadto przewijanie w widoku siatki nie działa. Dzieje się tak niezależnie od tego, że nawet jeśli nie ma wystarczającej liczby miniatur, aby spowodować przewijanie, aplikacja nadal ulegnie awarii

questionAnswers(3)

yourAnswerToTheQuestion