How can one set image from uri to the background of custom view without causing the stackoverflow error. As I couldn't find any appropriate answers, I hope to find it here.
Convert Bitmap to drawable
Drawable drawable = new BitmapDrawable(getResources(), bitmap);
Set drawable to your custom view
yourCustomView.setBackground(drawable);