title: Updating layoutParams not working
body: <p>I'm trying to calculate the dimension for this image, which will be downloaded from the web using this line<code>imgLoader.DisplayImage(url, R.drawable.thumbnail_background, image);</code>.
  The problem is that orgHeight becomes zero and you can't divide by zero. But why is this <code>orgHeight</code> 0?</p>
  
  <pre><code>// Add the imageview and calculate its dimensions
          //assuming your layout is in a LinearLayout as its root
          LinearLayout layout = (LinearLayout)findViewById(R.id.layout);
  
          ImageView image = (ImageView)findViewById(R.id.photo);
  
          ImageLoader imgLoader = new ImageLoader(getApplicationContext());
          imgLoader.DisplayImage(url, R.drawable.thumbnail_background, image);
  
          int newHeight = getWindowManager().getDefaultDisplay().getHeight() / 2;
          int orgWidth = image.getWidth();
          int orgHeight = image.getHeight();
  
          //double check my math, this should be right, though
          int newWidth = (int) Math.floor((orgWidth * newHeight) / orgHeight);
  
          //Use RelativeLayout.LayoutParams if your parent is a RelativeLayout
          LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
              newWidth, newHeight);
          image.setLayoutParams(params);
          image.setScaleType(ImageView.ScaleType.CENTER_CROP);
          layout.updateViewLayout(image, params);     
  </code></pre>
  
  <p>My imageView xml is like this:</p>
  
  <pre><code>&lt;ImageView
              android:id="@+id/photo"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_weight="1"
          /&gt;  
  </code></pre>