title: Android Activity contentView size
body: <p><img src="https://i.stack.imgur.com/FIPa2.png" alt="Sample"></p>
  
  <p>There are many question if you search.
  The answers are telling the screen width / height. NOT that needed!</p>
  
  <p><strong>I need the available space for the image view: the car with white background. How to get it?</strong> </p>
  
  <p>I don't need the top decoration bar, neither the bottom / right menu bar neither the whole screen size wich include the time, battery.</p>
  
  <p>Here is what I have tried so far:</p>
  
  <pre><code>public class MainActivity extends Activity {
  
      private SVGImageView svgImageView;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          //setContentView(R.layout.activity_main);
  
          svgImageView = new SVGImageView(this);
          svgImageView.setImageAsset("my.svg");
  
          // Set the ImageView as the content view for the Activity
          setContentView(svgImageView);
      }
  
  
  
      @Override
      protected void onPostResume() {
          super.onPostResume();
          int w = getWindow().getDecorView().getWidth();
          int h = getWindow().getDecorView().getHeight();
          Log.d("DisplayMetrics","w2:"+w+", h2:"+h);// 0 and 0
      }
  
  
  
      @Override
      protected void onStart() {
          super.onStart();
  
          DisplayMetrics metrics = getResources().getDisplayMetrics();
          int width = metrics.widthPixels;
          int height = metrics.heightPixels;
          //int bottom = svgImageView.getBottom();
  
          int w = svgImageView.getWidth();//0
          int h = svgImageView.getHeight();//0
  
          Log.d("DisplayMetrics", "width: "+width+ ", height:"+height+", w:"+w+", h:"+h);
          // landscape: 1280 x 752.  Real 1280x700
          // portrait: 800 x 1232. Real 800x1177
  
  
      }
  </code></pre>
  
  <p>SVGImageView is a child of ImageView more about SVG <a href="http://code.google.com/p/androidsvg/" rel="nofollow noreferrer">Here</a> if anyone interested.</p>