Code example for ProgressBar

Methods: setMaxsetProgresssetVisibility

0
            public void onClick(View v) {
                int count = Integer.parseInt(mNumberTextView.getText().toString());
                addEntriesToCallLog(count);
                mNumberTextView.setEnabled(false);
                mAddButton.setEnabled(false);
                mProgressBar.setProgress(0);
                mProgressBar.setMax(count);
                mProgressBar.setVisibility(View.VISIBLE);
            } 
        }); 
    } 
 
    /** 
     * Adds a number of entries to the call log. The content of the entries is based on existing 
     * entries. 
     * 
     * @param count the number of entries to add 
     */ 
    private void addEntriesToCallLog(final int count) {
        getLoaderManager().initLoader(CALLLOG_LOADER_ID, null, new CallLogLoaderListener(count));
    }