title: Android progressBar not showing
body: <p>I have a progressbar that is supposed to run in an AsyncTask , but it is not appearing, although the task runs</p>
  
  <p>XML:</p>
  
  <pre><code>&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"
  android:background="@drawable/splashportrait"&gt;
  &lt;ProgressBar android:layout_alignParentBottom="true" android:indeterminate="true"
      android:layout_centerHorizontal="true" android:paddingBottom="450dip"
      android:layout_width="200dip" android:layout_height="200dip"
      android:id="@+id/progressBar1"&gt;&lt;/ProgressBar&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>CODE:</p>
  
  <pre><code>ProgressBar diagProgress;
  
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.splashscreen);
  
      diagProgress = (ProgressBar)findViewById(R.id.progressBar1);
      DiagnosticsTask diag = new DiagnosticsTask();
      diag.execute();
  
    /**rest of class ommitted here**/
  }
  
  private class DiagnosticsTask extends AsyncTask&lt;String, String, Boolean&gt; {
  
      //Show spinner
      protected void onPreExecute() {
          //dialog.setMessage("Loading corresponding destinations...");
          //dialog.show();
          diagProgress.setVisibility(View.VISIBLE);
          diagProgress.showContextMenu();
          Log.e("AsyncStatus", "spinner shown");
      }
   /*other parts of the thread ommitted here*/
  
  }
  </code></pre>