getResources(). getDrawable(R.drawable.my_icon) obsolete, how to proceed

Asked

Viewed 51 times

0

Hi, I’m having trouble with the fact that getDrawable is obsolete. Please, how can I convert my code so it can be updated? I thank you in advance!

int height = 100;
    int width = 100;
    BitmapDrawable bitmapdraw=(BitmapDrawable)getResources().getDrawable(R.mipmap.guardian_ico);
    Bitmap b=bitmapdraw.getBitmap();
    Bitmap smallMarker = Bitmap.createScaledBitmap(b, width, height, false);

1 answer

0

Even though your question is not very objective I deduce by the syntax that you are programming for Android with the Java language using Android Studio. Use the Picasso library for image manipulation. It’s easy to integrate and super easy to use. Follow the link to the Doc on how to implement and how to use: http://square.github.io/picasso/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.