Example of full screen effect of ProgressDialog in Android

When doing the project, a ProgressDialog is directly used, which needs to achieve the effect of full screen, as shown in the figure below. When the function runs, it is found that it is not full screen, but only covers the current content, as shown in the figure below. However, find some information and solve the problem.

ProgressDialog inherits from alertdialog. Alertdialog inherits from dialog and implements the dialoginterface interface.

There are two ways to create ProgressDialog: new dialog and calling dialog's static method dialog. Show().

A cancellistener is required in method 5. The code is as follows:

Knowledge points of this paper:

1. Achieve the full screen effect of ProgressDialog

2. Recommended method of interface callback

Effect required by the project.png

Just beginning to achieve the effect.png

Code implementation:

1. Layout

2. Core code

3. Implementation of interface callback

4. Calling method of interface callback

5. All code implementation

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>