Android 14 can tell an app that a supported screenshot was taken while one of its Activities was visible. It does so through a per-Activity callback, not by giving the app the image. To use it, declare android.permission.DETECT_SCREEN_CAPTURE, register an Activity.ScreenCaptureCallback while the Activity is started, and unregister it when the Activity stops. Android also displays a system notice for each detection.
This is detection, not screenshot prevention. FLAG_SECURE prevents an Activity’s content from appearing in screenshots and non-secure displays; a secure window does not trigger the screenshot callback. The Android 14 API also covers only the documented hardware-button screenshot path, not every possible way a screen can be copied.
What the Android 14 screenshot detection API does
Android 14 (API level 34) introduced Activity.ScreenCaptureCallback, an Activity-scoped interface for learning that the monitored Activity was captured. When a qualifying screenshot occurs while that Activity is visible, Android calls onScreenCaptured(). The callback is a signal only: it does not contain a bitmap, file, URI, pixels or metadata describing the image. As the Android Developers guide puts it, “The callback doesn’t provide an image of the actual screenshot.”
Because the callback is attached to an Activity, it is not a device-wide screenshot monitor and cannot observe other apps. Your code must decide what response makes sense for the content that was displayed, such as recording an audit event or warning participants in a sensitive conversation.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#1 Best Overall
- YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
- LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
- MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
- NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
- BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.
See the official feature guide at Android Developers: Detect when users take device screenshots and the API reference for Activity.ScreenCaptureCallback.
How does Android detect screenshots?
On Android 14, the supported signal is tied to a specific combination of physical hardware-button presses used for the system screenshot gesture. Android invokes callbacks registered for the visible Activity and shows a system notice for each detection signal. This behavior is deliberately privacy-preserving: the app learns that a capture happened but cannot inspect the resulting image.
Do not describe this as universal detection. Android’s Android 14 feature documentation says screenshot test commands, including ADB commands and instrumentation captures of the current display, are outside this detection path. Screen recording, camera photography, remote capture, accessibility-based copying and manufacturer-specific behavior should not be assumed to generate this callback. Platform behavior can change in later releases, so verify the current API reference when targeting a newer Android version.
Required permission and lifecycle
Declare the permission
Add the permission to the application’s manifest:
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware match<uses-permission android:name="android.permission.DETECT_SCREEN_CAPTURE" />
The permission declaration is required before registering the callback. Keep the declaration in the application manifest (or the appropriate manifest source set) for builds that use this feature.
Rank #2
- Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Tracfone plan required, activating is easy, just 3 steps.
- DISPLAY: Immersive viewing on a 6.7-inch super-bright 120Hz display with powerful stereo speakers and Bass Boost for cinematic entertainment.
- CAMERA SYSTEM: Advanced 50MP Quad Pixel camera captures sharp, detailed photos and videos in any lighting condition
- PERFORMANCE: Lightning-fast 5G connectivity paired with a powerful processor and RAM Boost for smooth multitasking.
- BATTERY LIFE: Long-lasting 5000mAh battery with TurboPower charging technology delivers hours of power in minutes.
Register only while the Activity is started
The documented lifecycle pattern is to register from onStart() and unregister from onStop(). This associates monitoring with an Activity that is visible and avoids leaving a callback registered after the Activity is no longer in the foreground. Use the Activity’s mainExecutor unless your design requires another executor.
import android.app.Activity
import android.os.Bundle
import android.util.Log
class SensitiveActivity : Activity() {
private val screenCaptureCallback =
Activity.ScreenCaptureCallback {
// No image is available here. Handle the event you need to record.
Log.i("SensitiveActivity", "Supported screenshot detected")
// Example: notify your own conversation or audit subsystem.
}
override fun onStart() {
super.onStart()
if (android.os.Build.VERSION.SDK_INT >= 34) {
registerScreenCaptureCallback(mainExecutor, screenCaptureCallback)
}
}
override fun onStop() {
if (android.os.Build.VERSION.SDK_INT >= 34) {
unregisterScreenCaptureCallback(screenCaptureCallback)
}
super.onStop()
}
}
The API was added in API 34, so guard calls when your app can run on earlier Android versions. Compile against an SDK that contains the API, and keep the registration and unregistration paired on the same Activity instance. If you use a lambda form in Kotlin, retain the callback object so the exact same instance is passed to unregisterScreenCaptureCallback().
Java equivalent
public final class SensitiveActivity extends Activity {
private final Activity.ScreenCaptureCallback callback =
() -> {
// The callback supplies no screenshot image.
Log.i("SensitiveActivity", "Supported screenshot detected");
};
@Override protected void onStart() {
super.onStart();
if (Build.VERSION.SDK_INT >= 34) {
registerScreenCaptureCallback(getMainExecutor(), callback);
}
}
@Override protected void onStop() {
if (Build.VERSION.SDK_INT >= 34) {
unregisterScreenCaptureCallback(callback);
}
super.onStop();
}
}
Designing the callback response
What you can do
- Record an internal event stating that the visible Activity received a screenshot signal.
- Show an in-app explanation or update a conversation state according to your product policy.
- Ask your server to apply a policy to a sensitive workflow, provided your privacy notice explains that behavior.
What you cannot do
- Retrieve or analyze the screenshot pixels.
- Determine which region of the Activity was captured.
- Prove that every copy or recording of the screen was detected.
- Use the callback as a replacement for content protection.
Keep any user-facing behavior proportionate. Android supplies a system notice for each detection. The feature guidance recommends giving users an in-context notice when starting an Activity that uses the API, so the system notice does not appear unexplained.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Detection versus blocking with FLAG_SECURE
These mechanisms solve different problems:
| Mechanism | Purpose | Behavior | Important limit |
|---|---|---|---|
Activity.ScreenCaptureCallback |
Detect a supported screenshot of a monitored visible Activity | Invokes your callback and causes a system notice; supplies no image | Android 14 covers the documented hardware-button path, not ADB or instrumentation captures |
FLAG_SECURE |
Prevent Activity content from being captured | Stops content from appearing in screenshots and on non-secure displays | It is not an event feed, and the screenshot callback is not invoked for a window with this flag |
To apply the protection flag to an Activity window:
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
window.addFlags(WindowManager.LayoutParams.FLAG_SECURE)
setContentView(R.layout.activity_sensitive)
}
You can remove the flag later with window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE), for example when a user-controlled privacy setting changes. The Android reference suggests considering a setting that lets users control whether the flag is enabled. Decide deliberately: enabling the flag means the Activity will not produce the screenshot-detection callback for captures that the flag prevents.
Rank #3
- YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
- LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
- MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
- NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
- BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.
Testing and verification
Test the supported path
- Install a build containing the manifest permission and API-34 guard.
- Open the Activity so it is started and visible.
- Use the device’s documented hardware-button screenshot gesture.
- Confirm that Android displays its system notice and that your callback records the event.
- Navigate away and repeat a lifecycle test to confirm registration is removed in
onStop().
Do not use ADB as proof of detection
An ADB screenshot command or an instrumentation framework that captures the current display is useful for testing image output, but Android 14 does not promise that those captures invoke ScreenCaptureCallback. A test that expects a callback from those commands is testing an unsupported assumption, not an implementation bug.
Test secure-window behavior separately
Run the same gesture with FLAG_SECURE enabled. The Activity’s content should be excluded from screenshots and non-secure displays, and the callback should not run for that secure window. Test both flag states if your app lets users change the setting.
Troubleshooting
The code does not compile
Compile with an Android SDK that includes API 34 and import the correct android.app.Activity types. Keep runtime calls behind an API-level check for devices below Android 14.
The callback never fires on an older phone
The interface was added in API 34. On older releases there is no Android 14 callback to invoke; provide a compatibility behavior rather than assuming universal detection.
The callback never fires during automated tests
ADB and instrumentation screenshot captures are specifically outside the Android 14 detection path. Validate with the physical-button gesture on a visible, non-secure Activity.
Rank #4
- PRIVACY DISPLAY: Automatically hide your screen from those beside you. The built-in privacy display can be preset¹ to turn on when receiving notifications, typing passwords, or using specific apps
- TYPE IT IN. TRANSFORM IT FAST: Enhance any shot in seconds on your smartphone by using Photo Assist² with Galaxy AI.³ Add objects, restore details, or apply new styles by simply typing or tapping
- NIGHTS, CAPTURED CLEARLY: From gigs to city lights, record and capture moments after dark with clarity using Nightography so your photos and videos stay crisp and clear on your Samsung Galaxy
- MAKE IT. EDIT IT. SHARE IT: Turn everyday moments into something personal with creative tools built right into your mobile phone, whether it’s a special contact photo, custom wallpaper, an invitation or more⁴
- HELP THAT KEEPS UP: Stay in the moment while Now Nudge with Galaxy AI helps you respond faster and stay organized with smart suggestions⁵ that appear exactly when you need them on your phone
The callback fires unexpectedly or users are surprised
Android displays a notice with each detection. Explain your use of the API when the Activity starts, and make your own response clear without implying that your app received the image.
Free tools Windows power users keep installed
One-click scans. No signup required.
The callback is absent when FLAG_SECURE is enabled
That is expected. FLAG_SECURE prevents capture and the API reference states that the callback is not invoked for a window using the flag. Choose prevention or detection for that state, or expose a clearly explained user setting.
Unregistering throws or does not stop handling
Store the callback instance as a property and unregister that same instance in onStop(). Do not create a new lambda during unregistration. Pair each registration with one lifecycle teardown and avoid registering repeatedly from methods that can run while the Activity remains started.
Performance, privacy and reliability considerations
The callback is a lightweight notification; Android does not transfer screenshot pixels to your process. Keep the handler fast and move network or database work to your normal background mechanism so the main thread remains responsive. Treat the event as an indication of a supported capture, not cryptographic proof that a particular image was saved.
Document what you log, how long you retain it and who can see it. A screenshot signal can reveal that a user interacted with sensitive content, so apply the same access controls and retention limits as other security-related telemetry. Do not tell users that the feature detects cameras, screen recordings or every automated capture unless a separate, documented mechanism provides that coverage.
Best Value
- Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Activating is easy, just 3 steps.
- ACTIVATION Promotion: Includes 1500 min, 1500 texts & 1500 MB Data + add more as you need it
- CAMERA SYSTEM: 50MP Quad Pixel camera. Capture sharper, more vibrant photos day or night with 4x the light sensitivity.
- PERFORMANCE: Blazing-fast Qualcomm performance. Get the speed you need for great entertainment with a Snapdragon 680 processor and 4GB of RAM.
- 64GB built-in storage. Get plenty of room for photos, movies, songs, and apps. Made for US
Or skip the browser setup
If your actual goal is obtaining website screenshots rather than detecting screenshots inside an Android Activity, ScreenshotNeo provides a one-request website screenshot API. It is separate from Android’s on-device callback: you give it a URL and receive a PNG, JPEG, WebP or PDF.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo documentation for all options. Cookie and consent banners, newsletter popups and chat widgets are removed before the shot; bot checks, blank pages, failed loads, timeouts and cache hits cost nothing, and response headers identify the page verdict and whether it was billed. ScreenshotNeo also offers an MCP server with take_screenshot, get_page_info and capture_pdf for Claude, Cursor and other MCP clients. The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.
Further reference
- Android 14 features and APIs overview for the release context and supported behavior.
- Activity API reference for lifecycle and window behavior.
- ScreenCaptureCallback reference for the interface contract.
Frequently Asked Questions
Does Android give my app the screenshot file?
No. The callback reports that a supported capture occurred but provides no image, pixels, URI or screenshot contents.
Can I detect screenshots taken in another app?
No. The API is scoped to an Activity in your own app and is not a device-wide observer.
Recommended Free Tools
Should I use the callback or FLAG_SECURE?
Use the callback when you need a signal after a supported capture; use FLAG_SECURE when the Activity must be excluded from screenshots and non-secure displays. A secure window does not invoke the callback.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

