I am trying to place an image as background in my TextView. I want the image to get changed by pressing a button. At the first image gets loaded but when I try for next time it says OutOfMemoryError.
My Code:
int [] Quo = {R.drawable.wallpaper10,R.drawable.wallpaper2,R.drawable.wallpaper3,R.drawable.wallpaper4};
txtView.setBackgroundResource(Quo[j] );
It works perfectly if i give
txtView.setBackgroundResource(Quo[0]);
I am new to android development please help me resolve issue.