I have the following code:
Bitmap bMap = BitmapFactory.decodeResource(getResources(), R.drawable.icon);
imageView.setImageBitmap(bMap);
I am getting the error:
The method getResources() is undefined for the type ImageDownloader
How can I access my resources?
Create a new Constructor in your
ImageDownloaderclass with following code:Now you just need to change your download code a bit:
Hope this helps!!