Disable a whole activity from user action

后端 未结 7 647
再見小時候
再見小時候 2020-12-02 09:17

Is there a simple way to disable a user interacting with an activity. To be done when there is an action running (and a spinning progress bar in the title bar)

EDIT:

相关标签:
7条回答
  • 2020-12-02 10:02

    SpinningProgress in the title bar:

    //onCreate(): 
    activity.requestWindowFeature(FEATURE_INDETERMINATE_PROGRESS);
    
    //and then: 
    activity.setProgressBarIndeterminate(boolean indeterminate)
    

    both in Activity class

    Another option is using Progress Dialog (you might want to set cancelable to false on it).

    0 讨论(0)
提交回复
热议问题