title: How to scale bitmapdrawable (background) and keeping the aspect ratio till bigger than device's width and height
body: <p>I've decoded an image from the gallery to a bitmap, and i'm using a blur class to blur the bitmap.
  (<a href="https://stackoverflow.com/questions/25146865/error-when-trying-to-blur-image-using-renderscript-support-library-on-android-ph/">Error when trying to blur image using RenderScript support library on android phone</a>)</p>
  
  <p>I want to create a background from the blurred bitmap, but it's being stretched with this code (rl is my RelativeLayout):</p>
  
  <pre><code>  Uri selectedImageUri = data.getData();
            Blur blur = new Blur();
            imagepath = getRealPathFromURI(selectedImageUri);
  
            BitmapFactory.Options options = new BitmapFactory.Options();
            options.inJustDecodeBounds = true;
            BitmapFactory.decodeFile(imagepath, options);
            int pow = 0;
            while (options.outHeight &gt;&gt; pow &gt; options.outHeight / 2 || options.outWidth &gt;&gt; pow &gt; options.outWidth / 2) {
                pow += 1;
            options.inSampleSize = 1 &lt;&lt; pow; 
            options.inJustDecodeBounds = false;
            }
           Bitmap bmImg = BitmapFactory.decodeFile(imagepath, options);
           Bitmap BlurredIMG = Blur.doBlur(bmImg, 33, false);
           BitmapDrawable bmp = new BitmapDrawable(BlurredIMG);
           rl.setBackground(bmp);
  </code></pre>
  
  <p>How to keep the bitmap's aspect ratio and scale it so it will cover both width and height of the device?
  Do I need to use an ImageView instead? How?</p>