title: Set Height and Width of FrameLayout based on Bitmap
body: <p>I'm trying to set the <code>FrameLayout</code>'s width and height based on a <code>Bitmap</code>, what I did was below</p>
  
  <pre><code>        Bitmap theBitmap = BitmapFactory.decodeFile(theFileImage.toString());
          LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(theBitmap.getWidth(), theBitmap.getHeight());
          frame.setLayoutParams(lp);
          image.setLayoutParams(lp);
          image.setImageBitmap(theBitmap);
  </code></pre>
  
  <p>but I'm getting a <code>ClassCastException</code>.</p>
  
  <p>What did I do wrong?</p>
  
  <p>Edited:</p>
  
  <pre><code>java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.widget.RelativeLayout$LayoutParams
  </code></pre>