title: Progress bar (circle) not rotating in Android
body: <p>I am using Progress bar (Circle) while my data is loading from database in splash screen. I used the Progress bar in xml using its tags... but in activity it is not rotating... Suggest help..what's wrong with it?</p>
  
  <pre><code>xml:
  
  
  
            &lt;?xml version="1.0" encoding="utf-8"?&gt;
          &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="match_parent" &gt;
  
              &lt;ImageView
                  android:id="@+id/imgLogo"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_centerInParent="true"
                  android:background="@drawable/splash" /&gt;
  
              &lt;TextView
                  android:id="@+id/textView1"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_below="@+id/loading"
                  android:layout_centerHorizontal="true"
                  android:gravity="center_horizontal"
                  android:text="Loading data..."
                  android:visibility="visible"
                  android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
             &lt;ProgressBar
              android:id="@+id/loading"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_alignParentTop="true"
              android:layout_centerHorizontal="true"
              android:layout_marginTop="92dp"
              android:gravity="center"
              android:indeterminateDrawable="@drawable/custom_bar" /&gt;
      &lt;/RelativeLayout&gt;
  
      Java: 
  
      public class SplashScreen extends Activity {
          static String DATABASE_NAME = "ItemDB";
          static DBACESS mDbAccess = null;
          public static SQLiteDatabase mDB;
          public static ListItems objitem;
          private static int SPLASH_TIME_OUT = 100;
          private PackageManager packageManager = null;
          static DataEntryClass data = new DataEntryClass();
          static List&lt;ItemClass&gt; item_table;
          ProgressBar progressBar;
          @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              requestWindowFeature(Window.FEATURE_NO_TITLE);
              getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                      WindowManager.LayoutParams.FLAG_FULLSCREEN);
              setContentView(R.layout.activity_splash);
              progressBar = (ProgressBar) findViewById(R.id.loading);
              // ////////////////////////
              /////////////////////////
              CheckConnectionState(getApplicationContext());
              packageManager = getPackageManager();
  
              if (objitem == null)
                  objitem = new ListItems(getApplicationContext(), mDB);
  
              if (!objitem.ItemsExist(mDB))
                  try {
                      data.addItems(getApplicationContext());
                  } catch (Exception e) {
                      // TODO: handle exception
                  }
  
              new Handler().postDelayed(new Runnable() {
  
                  @Override
                  public void run() {
  
                      data.getNewUpdates(getApplicationContext(), packageManager);
                      item_table = new ArrayList&lt;ItemClass&gt;();
                      item_table = objitem.LoadItems(mDB);
  
                      Intent i = new Intent(SplashScreen.this, TabActivity.class);
                      startActivity(i);
  
                      // close this activity
                      finish();
                  }
              }, SPLASH_TIME_OUT);
          }
  
  
  
          public static void CheckConnectionState(Context ct) {
              try {
  
                  if (mDB == null || !mDB.isOpen()) {
                      DBACESS.DATABASE_NAME = DATABASE_NAME;
                      mDbAccess = new DBACESS(ct);
                      mDB = mDbAccess.getReadableDatabase();
                  }
              } catch (Exception e) {
  
              }
          }
      }
  
  custom_bar.xml:
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;rotate xmlns:android="http://schemas.android.com/apk/res/android"
  android:fromDegrees="0"
  android:pivotX="50%"
  android:pivotY="50%"
  android:toDegrees="360"
  android:repeatCount="infinite"
  android:drawable="@drawable/menu" &gt;
  &lt;/rotate&gt; 
  </code></pre>