This error appears because you are keeping a reference to the ProgressDialog that is itself keeping a reference to the destroyed activity that has a reference to the leaked DecorView.
Here is what you should do instead:
- Have a way to mark BackgroundTask as "running", such as a boolean field
- in onCreate(), check is "running" is true, and if yes, create a new progress dialog and show it
Also notice that @RootContext Activity apda
can be replaced with @RootContext AnnotationProgressDialogActivity apda
.