question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Taking a screenshot of the view

See original GitHub issue

Here’s my hierarchy:

CardView
     |
     -> ImageView

When I call

Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
            Canvas canvas = new Canvas(bitmap);
            view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight());
            view.draw(canvas);

it dumps the cardview and its contents into the bitmap just how I’d like it. After replacing the imageview with the youtubeplayerview, all i get is a black screen. On setting drawingCacheEnabled(), the controls of the video show up, but the video part remains black. Any clue why?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
PierfrancescoSoffritticommented, May 7, 2019

Let me know if you find a solution, could be useful to other users in the future 😃

0reactions
mariuspenacommented, Jun 7, 2021

@crearo please share the solution. we are also stuck

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Take a screenshot of a whole View
Actually I found the answer: public static Bitmap loadBitmapFromView(View v) { Bitmap b = Bitmap.createBitmap(v.getWidth() , v.
Read more >
How to Take a Screenshot on Any Phone or Laptop
To capture screenshots and automatically save them, press the Windows and Print Screen keys together. Screenshots are saved in a folder titled ...
Read more >
How to Take a Screenshot on Any Device
Open the Watch app on your iPhone, and navigate to My Watch > General > Enable Screenshots and toggle it on, or open...
Read more >
How to Take a Screenshot on your PC, Phone or Tablet
This screenshot will be automatically saved to your desktop. Press the Command, Shift and 4 keys together to take a screenshot of a...
Read more >
How to Capture Screenshot of a View and Save it ...
How to Capture Screenshot of a View and Save it to Gallery in Android? · Step 1: Create a new project · Step...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found