Android - show an indeterminate progressbar without the dialog

后端 未结 5 1890
既然无缘
既然无缘 2020-12-03 03:17

I want to show my progressbar in the center of the screen when a processing happens on a button click. But I just want the progressbar without the dialog box..

Is th

5条回答
  •  -上瘾入骨i
    2020-12-03 03:42

    The answer by @Jesse Finnerty solved my issue. what i did was:

    private ProgressBar mprogressBar;
    

    The inside oncreate() just like other buttons and textviews i did, mprogressBar = (ProgressBar) findViewById(R.id.progressBar);

    Then at the point i want spinning wheel to appear i give command

    mprogressBar.setVisibility(View.VISIBLE);
    

    at the point where i want it to disappear .

    mprogressBar.setVisibility(View.INVISIBLE);
    

    This is under switch actually. so that as the states in my program change, the progress bar appears and disappears

提交回复
热议问题