Code example for ProgressBar

Methods: setIndeterminatesetMaxsetProgress

0
    @Override 
    public void onProgressUpdate(Integer... values) {
        if (mProgressBar == null) {
            return; 
        } 
        mProgressBar.setIndeterminate(values[0] == values[1] ? true : false);
        mProgressBar.setMax(values[0]);
        mProgressBar.setProgress(values[1]);
    } 
 
    @Override 
    public void onTaskFinished() { 
        setProgressLock(false); 
    } 
 
    private void setProgressLock(boolean isLocked) {
        if (isLocked) {
            mButtonImport.setEnabled(false);
        } else { 
            mButtonImport.setEnabled(mCheckBoxImportWarning.isChecked());
        }