I have come across to see that ProgressDialog is now deprecated. What would be alternate one to use in place of that apart from ProgressBar.
I am
This class was deprecated in API level 26. ProgressDialog is a modal dialog, which prevents the user from interacting with the app. Instead of using this class, you should use a progress indicator like ProgressBar, which can be embedded in your app's UI. Alternatively, you can use a notification to inform the user of the task's progress. link
It's deprecated at Android O because of Google new UI standard