I use this code to make a screenshot. However, when I try to call it from the dialog (once user clicked the neutral button or when dialog.show()
is called) - the dialog itself is not captured. When (or where) should I use this code to capture the dialog also?
Asked
Active
Viewed 508 times
1
2 Answers
0
Maybe extending Dialog
and override onAttachedToWindow
method to call your screenshot method from there would work. Something like this.-
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
takeScreenshot();
}

ssantos
- 16,001
- 7
- 50
- 70
0
The code you are using uses drawing of root View to bitmap. Dialogs, Toasts and other extra windows have different View roots, therefore they do not appear in the screenshot.
Try out this library: https://github.com/jraska/Falcon it can solve your problem.

Josef Raška
- 1,291
- 10
- 8