I try to use method decodeResource from class BitmapFactory in my Activity like this:
Bitmap image = new BitmapFactory.decodeResource(getResources(),R.drawable.my_image);
I made all necessary imports, IntelliJ even completes method for me as I am type it but as I try to compile it gives me error:
java: cannot find symbol
symbol: class decodeResource
location: class android.graphics.BitmapFactory
Remove new
, because decodeResource
is static method,
Use like this
Bitmap image = BitmapFactory.decodeResource(getResources(),R.drawable.my_image);