Loading Indicator

Learn how a loading indicator can be used when blog data is loading.

Loading data from the network can take time, especially with a weak internet connection. Currently, while data is loading, the user sees a blank screen, which may be confusing. That’s why we need to introduce some kind of loading indicator.

We can show a simple ProgressBar, similar to what we did on the login screen, in the middle of the screen while data is loading.

Let’s start by declaring ProgressBar in the activity_blog_details.xml file and constrain it to the middle of the screen. Leave the ProgressBar visible by default.

Get hands-on with 1200+ tech skills courses.