I\'m trying to take a screenshot in code in Android. Actually the screenshot is the bitmap of the main RelativeLayout. The screenshot is taken but the content appears wrong, the
I'm assuming you're doing this during creation. Don't!
use a postDelayed(Runnable, int) to execute the Bitmap bm = Bitmap.createBitmap(v.getDrawingCache()); after the view is drawn.
Bitmap bm = Bitmap.createBitmap(v.getDrawingCache());
also, remove the v.measure() and v.layout() those are methods for the ViewGroup to be calling.