I'm trying to do add a progressbar in code and make it determinate:
progressBar = new ProgressBar(getActivity());
progressBar.setLayoutParams(layoutParams);
parent.addView(progressBar, index);
progressBar.setId(id.list_item_secondary);
progressBar.setProgressDrawable(getResources().getDrawable(drawable.progress_horizontal));
progressBar.setIndeterminate(false);
progressBar.setMax(100);
After progressBar.setIndeterminate(false)
, isIndeterminate
is still true and the progress keeps shows the indeterminate circle.
How can I make it determinate?