Screen capture inside the method onCreate not working in android
<p>I am working in an android application and I want to capture the screen of current activity in the Overrided method onCreate(). The bitmap returns null when I wrote the code for capturing screen inside the Overrided method onCreate(). But when I call the same code in a button click in the same activity the bitmap returns the correct value. Please correct my code to return by bitmap in my ocCreate() method itself.</p>

<p>My code is :</p>

<pre><code>View v1 = findViewById(R.id.printpreviewBaseScrollView);
v1.setDrawingCacheEnabled(true);
Bitmap bmv = v1.getDrawingCache();
</code></pre>
