What is the difference between Progressbar and progressDialog?

后端 未结 5 1791
一整个雨季
一整个雨季 2020-12-16 10:46

I have searched everywhere and read the official doc of Google. But I still don\'t see the difference between them.

When should we use ProgressBar and when should w

5条回答
  •  不知归路
    2020-12-16 11:11

    When your iterations is countable (doing operations in loop, executing code x times etc.) use ProgressBar, if task is not countable status (like invoking web service) use ProgressDialog

    From the android documentation

    ProgressBar:Visual indicator of progress in some operation. Displays a bar to the user representing how far the operation has progressed; the application can change the amount of progress (modifying the length of the bar) as it moves forward. There is also a secondary progress displayable on a progress bar which is useful for displaying intermediate progress, such as the buffer level during a streaming playback progress bar.

    ProgressDialog:A dialog showing a progress indicator and an optional text message or view. Only a text message or a view can be used at the same time.

提交回复
热议问题