Android apps block screenshots by marking their windows secure with a flag called FLAG_SECURE. Android then leaves that window out of screenshots and screen recordings, refuses to show it on screens it doesn't trust, such as a cast TV, and shows a plain card instead of a preview in recent apps. iPhone apps can find out that a screenshot was taken, but Apple offers no public way to prevent one. On both, a second camera pointed at the screen still works.
Here's what the flag does in practice, who uses it, the newer tools that detect instead of block, and the limits worth knowing.
What FLAG_SECURE does
FLAG_SECURE has been part of Android since API level 1, the very first release. The documentation describes it as a window flag that treats "the content of the window as secure, preventing it from appearing in screenshots or from being viewed on non-secure displays." In practice that covers four things:
- Screenshots. On a Pixel, pressing the screenshot buttons shows the message "Taking screenshots isn't allowed by the app or your organization", which comes from Android's own system text. Other phone makers word it differently. Google's guide to securing sensitive screens adds that if a malicious app grabs screenshots in the background, "the resulting image is blank."
- Screen recording and sharing. Recorders and screen-sharing apps capture to a display that isn't secure, so the window comes out blank. Android's display documentation says that on such a display "the user may see a blank region on the screen instead of the contents of secure surfaces." Google's guide also points out that this helps against screen-sharing scams, because legitimate screen-sharing apps are commonly used in fraud.
- Casting. Mirroring to a TV or a projector counts as a non-secure display too, so the secure window stays dark there.
- The recent-apps preview. Android normally saves a snapshot of each app for the recents screen. When a window is secure, it draws a snapshot "based solely on the theme" instead, in the words of Android's source code: a plain card in the app's colors, showing nothing of what was on screen. Since Android 13, an app that wants only this part, without blocking screenshots, can use setRecentsScreenshotEnabled instead.
One detail matters for app makers. The flag belongs to a window, and on Android a dialog is its own small window. Jetpack Compose's dialogs and pop-ups follow a secure flag policy that can inherit the setting from the window beneath, or force it on or off. An app that wants full coverage has to make sure every window it opens carries the flag.
Which apps use it
Google's guide names the typical users: "applications that need to protect sensitive information, like banking apps or password managers." A few examples you may already have:
- Files by Google. Its Safe folder is a space locked with a PIN or pattern, and Google's help page states that "Screenshots of the Safe folder can't be taken."
- Samsung Gallery. On select phones with One UI 8.5, the private album has screenshots "disabled inside it for added privacy."
- Signal. Its Screen security setting, in the app's privacy settings, keeps chats out of the recent-apps preview, and on Android, Signal's own app text notes that it "will also disable screenshots."
Because the flag also blocks screenshots you might want, Google suggests developers "consider adding a setting in your app that allows users to toggle this flag", in its screenshot detection guide. That's why some apps, Signal among them, leave the choice to you.
Newer tools that detect instead of block
Recent Android versions added gentler options for apps that want to know about a capture, or protect only part of a screen.
| Feature | Since | What it does |
|---|---|---|
| Screenshot detection | Android 14 | The app is told when you take a screenshot with the button combination, and Android shows you a notice |
| Screen recording detection | Android 15 | The app is told when its windows become visible or invisible in a screen recording |
| Sensitive views | Android 15 | The app marks single views, such as a password field, and Android treats their window as secure while the screen is shared or recorded |
| Single-app sharing | Android 14 QPR2 and 15 | You share or record one app instead of the whole screen |
Some details worth knowing:
- Screenshot detection uses a normal permission,
DETECT_SCREEN_CAPTURE. The Android 14 documentation says the app never receives the image, and the system shows a notice such as "Pay app detected this screenshot" so you know. It doesn't detect screenshots taken with developer tools such as adb. - Recording detection in Android 15 lets an app warn you that it's being recorded while you do something sensitive. It needs the
DETECT_SCREEN_RECORDINGpermission. - Sensitive views use setContentSensitivity. Android also decides on its own in some cases: views that autofill recognizes as usernames, passwords or card details count as sensitive.
- Sharing one app arrived in Android 14 QPR2 and became standard in Android 15. Since Android 15 QPR1, a chip in the status bar shows when your screen is being shared, cast or recorded, and any session stops when the screen locks.
Detection is a different promise from blocking. A detected screenshot still exists. The app can only react, for example by warning you or telling the other person in a chat.
What iPhone apps can and can't do
iPhone takes a different approach, and Apple's tools are good at what they're designed for:
- After a screenshot. Apps can listen for userDidTakeScreenshotNotification, which, in Apple's words, "posts after the screenshot is taken."
- During recording, mirroring or remote control. Since iOS 17, sceneCaptureState tells an app whether its scene "is currently being mirrored or recorded." Apple's guidance for banking, payments and healthcare apps is to hide or redact sensitive fields, and pause risky actions, while a capture is running.
- In the app switcher. Apps can cover their own snapshot before going to the background, a technique Apple documents in Technical Q&A QA1838.
- Blocking a screenshot. Not through public APIs. Asked by a developer in April 2026, Apple's developer support replied: "There are no public APIs available for preventing screenshots at this time" (Apple Developer Forums). Some apps lean on secure text fields to hide content, but Apple's engineers describe that as "a side effect of how secure text fields work, not a documented feature" that may change with any update.
Apple's guidance is open about the trade-off it weighs. Capture detection fires for everyday uses too, like recording a tutorial, and "a blanket app-level lockdown may frustrate people with legitimate screen-sharing needs." Android leaves that decision to each app, and the best apps pass it on to you. For the wider picture, see Android vs iPhone for privacy in 2026.
The limits no flag can fix
FLAG_SECURE is strong at one job: keeping a window out of anything Android itself captures or sends to another screen. It has honest limits:
- A second camera. Nothing on either platform stops someone photographing the screen with another phone.
- A compromised phone. On a rooted or infected phone, whoever controls the system can ignore the flag, along with every other rule an app relies on.
- Older Android versions. Google's guide says that on Android 11 and older, the flag helps reliably on around 70% of devices, "because on certain devices keyboard taps can be recorded."
- Apps that read the screen. Accessibility services, which read a screen's text aloud or act on it, are a separate channel from screenshots. Google says malicious apps sometimes abuse them to read "passwords and financial details, directly from the screen", which is why Google now gives apps a one-line way to keep sensitive views away from anything that isn't a genuine accessibility tool. Grant accessibility access only to apps you trust.
- Copies you send. Once a photo leaves the app, the person who receives it can screenshot their copy. Sending private photos safely covers what helps there.
Within those limits, the flag removes the easy accidents: a screenshot that lands in your gallery and syncs to the cloud, a recents preview a friend glimpses while you switch apps, or a screen-sharing call that shows more than you meant to. It's one of the privacy powers Android has that iPhone doesn't.
How Cachette uses it
Every window in Cachette, dialogs included, is marked secure with FLAG_SECURE. Screenshots, screen recording and casting are blocked, and the recent-apps preview is blank. That includes the screen that shows a backup's 24-word recovery phrase, which is why you write the words on paper, with a note of which backup they open.
The flag works alongside the rest of the design: turning the screen off locks the vault and clears keys and thumbnails from memory, and leaving the app locks it. The limits above apply to Cachette too. A second camera, or someone looking over your shoulder, is beyond what any app can stop, and with a screen reader on, Cachette speaks dot positions aloud, so headphones help near other people. The security page has the details.