title: Screenshot of complete screen with controls with scroll in Android Studio
body: <p>I've a screen in android, which has multiple controls like a <code>Listview</code> and <code>TextView</code> and some buttons to save the record.</p>
  <p>If there are more question (say 15) the <code>Listview</code> is displayed in scroll bar as the <code>Listview</code> has fixed length. We have used the below code to take screenshot of the screen on save but when we have more questions in <code>Listview</code> the screen shot is taken only for the record available in the screen. Please suggest how I can take screenshot of all the questions in the <code>Listview</code> when we have more.</p>
  <p>Code Used to take screenshot where View is the <code>LinerLayout</code> defined in <code>.xml</code> file</p>
  <p>Sample :1</p>
  <pre><code>public Bitmap screenShot(View v) {
              v.setDrawingCacheEnabled(true);
              Bitmap bitmap = Bitmap.createBitmap(v.getDrawingCache());
              v.setDrawingCacheEnabled(false);
              return bitmap;
          }
  </code></pre>
  <p>Sample :2</p>
  <pre><code> Bitmap bitmap = Bitmap.createBitmap(v.getMeasuredWidth(), v.getMeasuredHeight(), Bitmap.Config.ARGB_8888);
                  Canvas canvas = new Canvas(bitmap);
                  Drawable bgDrawable = v.getBackground();
                  if (bgDrawable != null)
                      bgDrawable.draw(canvas);
                  else
                      canvas.drawColor(Color.WHITE);
                  v.draw(canvas);
  </code></pre>