Android: how to disable controls during progress bar is active

后端 未结 4 2327
逝去的感伤
逝去的感伤 2021-02-19 08:47

I show my infinte progress bar in the action bar \"as usual\":

requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
...
setProgressBarIndeterminateVisibi         


        
4条回答
  •  我在风中等你
    2021-02-19 09:29

    You are trying to set just the Property of Activity. Instead Bring up a dialog using ProgressDialog, so that Ui will not be accessible

    ProgressDialog dialog = ProgressDialog.show(this, "", "Please wait...", true);
    

    Edit: If you do not want to use ProgressDialog, get the Root Layout and call

    layout.setEnabled(false)
    

提交回复
热议问题