bugshaker-android
bugshaker-android copied to clipboard
Cannot Screenshot Dialog
Hi, I have alert dialog that was created by using AlertDialogBuilder.create() method. When the dialog is shown on the screen, I shake and the screenshot only covers the layer behind the dialog, without capturing the dialog.
This is a known limitation of the library. Dialogs are presented in separate Windows and are not technically part of the Activity being captured.
Some solutions to this problem exist, but with their own tradeoffs:
- https://developer.android.com/reference/android/app/UiAutomation.html#takeScreenshot() (minSdk 18, can be flaky, not sure if this handles MapViews or not)
- https://github.com/jraska/Falcon (uses reflection to identify all windows, then loops through them and composites the results, but probably doesn't include dimming effects?)
I currently do not have the time or interest to explore these alternatives; however, if you would like to fork BugShaker and experiment with them yourself, you are welcome to! All of the existing screenshot-capturing code lives in this package: https://github.com/stkent/bugshaker-android/tree/8ff33357268c151782ec934f4e5502609756d7cd/bugshaker/src/main/java/com/github/stkent/bugshaker/flow/email/screenshot.