Customize circular Progress bar with progress status based on network calls and responses
<p>i am new to android and i am trying to build a customized circular <code>ProgressBar</code> according to network calls..means </p>

<p>1.when i click the <code>Button</code>, the <code>ProgressBar</code> should load 50% </p>

<p>2.when i get response from server, it must load other 50% to complete the action
thank you in advance</p>

<p>and here is my Prog.java Class</p>

<pre><code>public class Prog extends Activity {

    private ProgressBar progBar;
    private TextView text;
    private Handler mHandler = new Handler();
    private int mProgressStatus=0;
    int load=0;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_prog);
      progBar= (ProgressBar)findViewById(R.id.progressBar);
      dosomething();

  }

  public void dosomething() {

      new Thread(new Runnable() {
          public void run() {
              final int presentage=0;
              while (mProgressStatus &lt; 50) {
                  mProgressStatus += 1;
                  // Update the progress bar
                  mHandler.post(new Runnable() {
                      public void run() {
                          progBar.setProgress(mProgressStatus);


                      }
                  });
                try {

                    Thread.sleep(50);

                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }

         }
        }).start();
    }

 }
</code></pre>