title: Android - Check any dialog is displayed on the screen and get the dialog instance
body: <p>I have a requirement that I need to check if there is any Dialog displayed on the screen from the non activity class(library project). If the dialog is displaying on the screen Then I need to dismiss the dialog. </p>
  
  <p>I have an activity instance stored in the library project. How can I check any dialog is displayed over the activity with out storing the dialog instance in the activity.</p>
  
  <p>Please let me know if there is any way to do this.</p>