I tried to take a Screenshot every second, to find out, if the user is in a menu of another app. I found a function in Display named capturePhoto(...) but it's a void function. I also tried it with Robot, but it isn't supported.
I googled it, but only found text not code to use.
The function I found: Display.getInstance().capturePhoto(null);
I don't know what goes there instead of null