1

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;
    }
Diego
  • 937
  • 8
  • 24
  • What you have shared is not an `Error`. Simply share your `logcat` so it might b helpful. – sajjad Aug 04 '20 at 13:23
  • 1
    Logcat is above, When picture runs on screen it gives screenshot of it but When play video suddenly app is closed and it gives at above info – Diego Aug 04 '20 at 13:40

0 Answers0