Skip to content

Commit

Permalink
Fix for OOM in Rounded Drawable
Browse files Browse the repository at this point in the history
  • Loading branch information
GauravGangwarZomato authored and vinc3m1 committed Dec 6, 2018
1 parent c1d66da commit 497a2d4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import android.widget.ImageView.ScaleType;
import java.util.HashSet;
import java.util.Set;
import java.lang.Throwable;

@SuppressWarnings("UnusedDeclaration")
public class RoundedDrawable extends Drawable {
Expand Down Expand Up @@ -135,7 +136,7 @@ public static Bitmap drawableToBitmap(Drawable drawable) {
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);
} catch (Exception e) {
} catch (Throwable e) {
e.printStackTrace();
Log.w(TAG, "Failed to create bitmap from drawable!");
bitmap = null;
Expand Down

0 comments on commit 497a2d4

Please sign in to comment.