2

The Progress Dialog is deprecated now for android O. What is the solution for this?

I am getting below warnings . In My project

Warning:(6, 20) 'Progress Dialog' is deprecated. Deprecated in Java
Warning:(72, 43) 'Progress Dialog' is deprecated. Deprecated in Java
Warning:(89, 27) 'Progress Dialog' is deprecated. Deprecated in Java

I didn't find solution for the same problem.

AskNilesh
  • 67,701
  • 16
  • 123
  • 163

2 Answers2

2

According to google:

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.

https://developer.android.com/reference/android/app/ProgressDialog.html

Orkun Kocyigit
  • 1,137
  • 10
  • 21
2

Custom ProgressBar is the answer. You can write your own or use something like DelayedProgressDialog from https://github.com/Q115/DelayedProgressDialog

Usage:

DelayedProgressDialog progressDialog = new DelayedProgressDialog();
progressDialog.show(getSupportFragmentManager(), "tag");
NinjaCowgirl
  • 2,301
  • 2
  • 13
  • 14