I am trying to get Screen shot of device in android, I used below code to take screen shot, it works for image and widget but When video is running and trying get screen shot of it, it gives below error. How can I solve this problem and I get screenshot of playing video on screen
Do partial code cache collection, code=26KB, data=30KB
After code cache collection, code=26KB, data=30KB
Increasing code cache capacity to 128KB
Code
Bitmap image = Utils.screenShot(activity.getWindow().getDecorView().getRootView());
image = Utils.getResizedBitmap(image, 500);
public static Bitmap screenShot(View view) {
Bitmap bitmap = Bitmap.createBitmap(view.getWidth(),
view.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
view.draw(canvas);
return bitmap;
}