title: how to find the layout width and height in xml?
body: <p><img src="https://i.stack.imgur.com/QnDOY.jpg" alt="enter image description here"></p>
  
  <p>In this image as show red box ,in that i'm displaying a <code>ListView</code></p>
  
  <p>How to display the list view and how to find the width and height of the image??</p>
  
  <p>In this red box i'm displaying a <code>ListView</code> (like contacts), but i'm adding a list view in
    run time. </p>
  
  <p>How to find the that red box size in run time??</p>
  
  <pre><code>   &lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/cm"
    android:orientation="vertical" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/backbg"
    &gt;
  
  
     &lt;LinearLayout 
    android:orientation="vertical" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_marginTop="20dp"
    &gt;
  
  
  &lt;AbsoluteLayout 
  android:orientation="horizontal" 
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:layout_marginTop="55dp"
  android:layout_gravity="center_horizontal"
  
  
    &gt;
  
    &lt;Button 
         android:id="@+id/ckbtn0"
         android:layout_width="54dp"
         android:layout_height="50dp"
         android:background="@drawable/back1"
  
         android:layout_marginLeft="2dp"
         android:layout_x="-1dp"
         android:layout_y="5dp"
      /&gt; 
  
  
  
        &lt;Button 
         android:id="@+id/refresh0"
          android:layout_width="54dp"
          android:layout_height="50dp"
          android:layout_gravity="center"
         android:layout_x="74dp"
         android:layout_y="5dp" 
         android:background="@drawable/refresh1"
        /&gt; 
        &lt;Button
      android:id="@+id/ImageView01" 
       android:layout_width="50dp"
      android:layout_height="36dp"
      android:background="@drawable/search1"
      android:layout_x="230dp" 
      android:layout_y="5dp"&gt;
      &lt;/Button&gt;
                &lt;EditText 
              android:layout_width="45dp"
              android:layout_height="50dp"
              android:id="@+id/cet0"
              android:imeOptions="actionSearch"
               android:layout_gravity="center"
              android:visibility = "gone"
              android:layout_x="297dp"
              android:layout_y="15dp" 
              android:singleLine="true" 
              android:imeActionLabel="Search"
              /&gt;
  
  
       &lt;Button 
          android:id="@+id/ckbtn1"
          android:layout_width="54dp"
          android:layout_height="50dp"
           android:layout_gravity="center"
          android:background="@drawable/add"
          android:layout_x="429dp"
          android:layout_y="5dp" 
           /&gt; 
  
  
      &lt;/AbsoluteLayout&gt;
  
       &lt;TextView
          android:layout_width="309dp"
          android:layout_height="15dp"
           /&gt;            
  
  
  
  
  
  
        &lt;LinearLayout
        android:layout_width="match_parent"
        android:layout_height="490dp"
        android:gravity="top"
       android:orientation="vertical"
       android:background="@android:color/transparent"
       android:layout_marginTop="30dp"
        &gt;
  
     &lt;ListView android:id="@+id/clistview"  
     android:layout_height="match_parent"
      android:layout_width="match_parent"
     android:divider="#2867EA"
     android:dividerHeight="1dp"
  
  
      android:cacheColorHint="#00000000"
      &gt;
    &lt;/ListView&gt;
    &lt;/LinearLayout&gt;
  
  
  
      &lt;LinearLayout 
     android:orientation="horizontal" 
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
    android:background="@android:color/transparent"
    android:layout_marginTop="28dp"
    &gt;
  
  
     &lt;Button android:id="@+id/pbtn0"
      android:layout_width="76dp"
  android:layout_height="35dp"
     android:layout_gravity="bottom"
    android:background="@null"
      android:layout_x="-1dp"
  android:layout_y="393dp"
  
      /&gt;
  
  
       &lt;Button android:id="@+id/nbtn1"
        android:layout_width="53dp"
    android:layout_height="33dp"
       android:layout_marginLeft="190dp"
       android:background="@null"
        android:layout_gravity="bottom"
       android:layout_x="300dp"
  android:layout_y="450dp" 
  
      /&gt;
  
      &lt;/LinearLayout&gt;
  
  
  
  
      &lt;/LinearLayout&gt;   
  
      &lt;/LinearLayout&gt;
  </code></pre>