Code example for ProgressBar

Methods: getMaxsetProgresssetVisibility

0
    } 
 
    @Override 
    protected void onProgressUpdate(Double... update) {
      indeterminateProgress.setVisibility(View.GONE);
      determinateProgress.setVisibility(View.VISIBLE);
 
      double scaler = update[0];
      determinateProgress.setProgress((int)Math.floor(determinateProgress.getMax() * scaler));
    } 
 
    @Override 
    protected void onPostExecute(Void result) {
      VersionTracker.updateLastSeenVersion(DatabaseUpgradeActivity.this);
      startActivity((Intent)getIntent().getParcelableExtra("next_intent"));
      finish();
    } 
 
    @Override 
    public void setProgress(int progress, int total) {
      publishProgress(((double)progress / (double)total));