This question is an exact duplicate of:
I know this question has been asked many times.I am aware of two ways to do it.(1)Using screenshot library(But I am getting black screen all the time).(2)getting data from frame buffer with rooting||\dev\graphics\fb0||(But it is always 0 byte and I do not know exact location where current screenshot of device is stored).My preferred requirement is getting better frame rate.Any help will be very helpful as I have spent a lot of time in this.
You can get the drawing cache of your view using the following code:
You can use this: