I\'ve been adding a ProgressBar
to the fragments in my app. I\'ve set it up to the two main fragments (used as tabs) as follows:
ProgressBar
in
I had a same issue (progressBar.setVisibility() was not working).
As @Illegal Argument said,
// in Activity
ProgressBar mProgressBar = (ProgressBar)findViewById(R.id.progressBar1);
mProgressBar.setVisibility(View.GONE);
should be working, if that code runs on uiThread(mainThread).
My problem was that I was trying to run the code not on uiThread. So I solved the issue by changing code from
mProgressBar.setVisibility(View.GONE);
to
runOnUiThread(new Runnable() {
@Override
public void run() {
mProgressBar.setVisibility(View.GONE);
}
});