This method can be called inside the onDestroy () of the activity, in order to avoid the exception "WindowManager: android.view.WindowLeaked: Activity com.example.myactivity has leaked window DecorView @ 7bede62", if the activity is destroyed when the dialog is displayed.
This method can be called inside the onDestroy () of the activity, in order to avoid the exception "WindowManager: android.view.WindowLeaked: Activity com.example.myactivity has leaked window DecorView @ 7bede62", if the activity is destroyed when the dialog is displayed.