Is it possible to hide android screenshot toolbar but detect the screenshot to show my custom screenshot toolbar from app?

I tried:

getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);

It doesn't allow taking screenshots, and I don't get the event of the screenshot. How can I allow screenshots but hide android's screenshot toolbar and show my own nudge?

0

There are 0 best solutions below