title: Getting View object of any AlertDialog instance that is visible in current Activity (Android)
body: <p>I have code that will take a drawing screenshot of the current window's root view.</p>
  
  <p>The problem is, the screenshot is only taken of the activity that is running.  It does not draw any AlertDialog that may be visible inside the activity.</p>
  
  <p>Is there a way that I can get a screen drawn of the current activity and any other visible AlertDialogs/Views?</p>
  
  <p>Current code:</p>
  
  <pre><code> View v1 = getWindow().getDecorView().getRootView();
   v1.setDrawingCacheEnabled(true);
   Bitmap bitmap = Bitmap.createScaledBitmap(v1.getDrawingCache(), 360, 740, false);
   v1.setDrawingCacheEnabled(false);
  </code></pre>