title: Android change ProgressDialog drawable while dialog works
body: <p>I have a ProgressDialog which i started when Activity is Created(insideOnCreate method).</p>
  
  <pre><code>private void initDialog() {
      mProgressDialog = new ProgressDialog(this);
      mProgressDialog.setIndeterminate(true);
      mProgressDialog.setTitle("Please wait.");
      mProgressDialog.setMessage("Connecting to LinkedIn.");
      mProgressDialog.setCancelable(false);
      mProgressDialog.show();
  }
  </code></pre>
  
  <p><strong>After 2500ms</strong> i want to change a circle animation to my custom image(see below) (like an a simulation about when i finish retrieve some data from server and i'm done.) So i need to show user that process is finished. For this goal i select a next way.</p>
  
  <ol>
  <li>I show dialog</li>
  <li>When i retrieve data i change drawable of ProgressDialog</li>
  </ol>
  
  <p>And this i have a problem. When i set the first time a drawable </p>
  
  <pre><code>private void initDialog() {
      mProgressDialog = new ProgressDialog(this);
      mProgressDialog.setIndeterminate(true);
      mProgressDialog.setTitle("Please wait.");
      mProgressDialog.setMessage("Connecting to LinkedIn.");
      mProgressDialog.setCancelable(false);
      //This
      mProgressDialog.setIndeterminateDrawable(getResources().getDrawable(R.drawable.ok));
      mProgressDialog.show();
  }
  </code></pre>
  
  <p>ProgressDialog change drawable and all looks ok. But when ProgressBar launched(worked/circle animation playing) i try to reset a drawable</p>
  
  <pre><code>mProgressDialog.setIndeterminateDrawable(getResources().getDrawable(R.drawable.ok));
  </code></pre>
  
  <p>And i have unexpected result : circle animation disappear and no image set to current progress drawable. NO IMAGE! BLANK AREA instead of my image.</p>
  
  <pre><code>    authButton.postDelayed(new Runnable() {
          @Override
          public void run() {
              mProgressDialog.setIndeterminateDrawable(getResources().getDrawable(R.drawable.ok)); //doesn't work as expected!
          }
      }, 2500);
  </code></pre>
  
  <h3>So my question is - how i can change drawable in runtime during ProgressDialog works?</h3>
  
  <h2><img src="https://i.stack.imgur.com/tMMwLl.png" alt="enter image description here"> need to be changed to <img src="https://i.stack.imgur.com/p77JRs.png" alt="enter image description here"></h2>