title: show progress bar center of screen
body: <p>I using a progress bar inside my layout. When I start the app the progress bar is always aligned to top left corner of screen. Below is my xml layout file.  how can I align it on centre of the screen. !!</p>
  
  <pre><code>&lt;RelativeLayout 
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/relativeLayout1"
      android:orientation="vertical"    
      android:background="#F1F1F1"&gt;
  
      &lt;ScrollView
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" &gt;
          &lt;LinearLayout 
             android:layout_width="fill_parent"
             android:layout_height="fill_parent"
             android:orientation="vertical"
             android:id="@+id/scrolllinear"&gt;
  
      &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:id="@+id/LinearLayout1"
                  android:orientation="vertical"
                  android:visibility="gone" &gt; 
  
      &lt;RelativeLayout android:id="@+id/layout_category1"
                  android:padding="10.0dip"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginLeft="10.0dip"
                  android:layout_marginTop="10.0dip"
                  android:layout_marginRight="10.0dip"
                 android:clickable="false"
                 android:descendantFocusability="blocksDescendants"&gt;
  
                  &lt;ImageView
                  android:id="@+id/more_1"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_alignParentRight="true"
                  android:layout_centerVertical="true"
                  android:src="@drawable/more"/&gt;
  
                  &lt;TextView android:textSize="28.0sp"
                      android:id="@+id/tv_category1"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:text="more 1"
                      android:layout_toLeftOf="@id/tv_see_more_1"
                      android:layout_alignParentLeft="true"
                      android:layout_centerVertical="true"&gt;
                  &lt;/TextView&gt;
      &lt;/RelativeLayout&gt;
  
      &lt;horizontalscrollview
          android:id="@+id/HMscrollView"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_below="@+id/layout_category1"&gt;        
  
          &lt;LinearLayout
              android:id="@+id/myLayout"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:orientation="horizontal"
              android:layout_margin="5dp"&gt;
          &lt;/LinearLayout&gt;
      &lt;/horizontalscrollview&gt;
      &lt;/LinearLayout&gt;
  
  
      &lt;LinearLayout
          android:id="@+id/progLayout"
          android:orientation="vertical"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:background="@null"
          android:visibility="gone"
          android:layout_gravity="center"&gt;
  
           **&lt;ProgressBar
              android:id="@+id/progressBar"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"    
              android:indeterminateDrawable="@drawable/my_progress_indeterminate" &gt;
           &lt;/ProgressBar&gt;**
          &lt;/LinearLayout&gt;
          &lt;TextView 
              android:id="@+id/CheckTest"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center"
              android:text="try again."
              android:visibility="gone"
              android:textSize="25.0sp"
              android:textStyle="bold"
              android:layout_marginTop="130dp"
              &gt;&lt;/TextView&gt;
  
     &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:orientation="vertical"
                  android:id="@+id/LinearLayout2"
                  android:visibility="gone" &gt;
  
      &lt;RelativeLayout android:id="@+id/layout_category2"
                  android:padding="10.0dip"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginLeft="10.0dip"
                  android:layout_marginTop="10.0dip"
                  android:layout_marginRight="10.0dip"&gt;
  
                  &lt;ImageView
                  android:id="@+id/tv_see_more_2"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_alignParentRight="true"
                  android:layout_centerVertical="true"
                  android:src="@drawable/more"/&gt;
  
                  &lt;TextView android:textSize="28.0sp"
                      android:id="@+id/tv_category2"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_toLeftOf="@id/tv_see_more_2"
                      android:layout_alignParentLeft="true"
                      android:layout_centerVertical="true"&gt;
                  &lt;/TextView&gt;
      &lt;/RelativeLayout&gt;
  
  
      &lt;horizontalscrollview
          android:id="@+id/scrollViewHM2"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_below="@+id/layout_category2"&gt;
  
          &lt;LinearLayout
                      android:id="@+id/myLayout2"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:orientation="horizontal" &gt;
          &lt;/LinearLayout&gt;
      &lt;/horizontalscrollview&gt;
      &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
      &lt;/ScrollView&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>