October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Android 14

How Android 14 Screenshot Detection APIs Work

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Android 14 lets an app learn when a qualifying screenshot is taken of one of its visible Activities: declare android.permission.DETECT_SCREEN_CAPTURE, register an Activity.ScreenCaptureCallback while the Activity is started, and unregister it when the Activity stops. The callback reports that a capture happened; it does not give the app the screenshot. It is not a way to block screenshots or detect every kind of screen capture.

What Android 14 screenshot detection does

Android 14 (API level 34) added an Activity-scoped callback for supported screenshot events. When a qualifying screenshot is taken while a monitored Activity is visible, Android calls the app’s callback and displays a system notice to the user. The callback does not provide a bitmap, image, or the contents of the screenshot. Your app must decide what response, if any, makes sense for the screen it was showing at the time. See the Android screenshot detection guide and the Activity.ScreenCaptureCallback reference.

This is not a device-wide observer. Registering on one Activity does not give your app a feed of screenshots taken in other apps or elsewhere on the device. Think of it as a limited signal about a capture of the Activity you chose to monitor, not access to captured material.

What it detects—and what it does not

The supported screenshot path

On Android 14, the documented detection path covers a specific combination of physical hardware-button presses used to take a screenshot. Do not describe it as detecting every way a person or tool could copy, record, or photograph what is on screen.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Samsung Galaxy A17 5G Smart Phone 128GB US 1 Yr Manufacturer Warranty Black
  • 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.

ADB and instrumentation captures

Screenshot test commands, including ADB commands and instrumentation tests that capture the device’s current screen, are outside this API’s supported detection path. Their failure to invoke the callback does not establish that your registration is broken. Conversely, a successful callback for a physical-button screenshot does not mean the app can detect all forms of capture. The Android 14 features overview describes the platform’s feature scope.

What the callback tells your app

The event says that Android detected a supported capture of the monitored Activity. It does not identify the image’s contents, provide the screenshot, or tell your app which pixels or views ended up in it. If your response depends on what the user was viewing, keep that context in your own Activity state; do not expect Android to send it back as screenshot data.

Rank #2
Tracfone Motorola Moto G 2025, 64GB, Saphire Blue (Locked to
  • 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.

Implement the callback in an Activity

The basic lifecycle is: declare the permission, keep one callback instance, register it as the Activity starts, and unregister it as the Activity stops. Android’s feature guide documents this lifecycle pattern. Using mainExecutor runs the callback on the Activity’s main executor, which is a practical choice for updating UI.

1. Add the manifest permission

<manifest ...>
    <uses-permission android:name="android.permission.DETECT_SCREEN_CAPTURE" />

    <application ...>
        ...
    </application>
</manifest>

This is the permission named by Android’s documentation for the feature. The declaration does not turn the callback into a screenshot-reading capability.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Samsung Galaxy A17 5G Smart Phone 128GB, US 1 Yr Manufacturer Warranty Blue
  • 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.

2. Register and unregister in Kotlin

import android.app.Activity
import android.os.Bundle
import android.widget.Toast

class SensitiveActivity : Activity() {
    private val screenCaptureCallback =
        Activity.ScreenCaptureCallback {
            // This is an event signal only; no screenshot image is provided.
            Toast.makeText(
                this,
                "A screenshot was detected for this screen.",
                Toast.LENGTH_SHORT
            ).show()

            // Replace or supplement this with a proportionate,
            // app-defined response if the screen's context requires one.
        }

    override fun onStart() {
        super.onStart()
        registerScreenCaptureCallback(mainExecutor, screenCaptureCallback)
    }

    override fun onStop() {
        unregisterScreenCaptureCallback(screenCaptureCallback)
        super.onStop()
    }
}

The callback is stored as a property so the same instance is passed to registration and unregistration. Tying registration to onStart() and unregistration to onStop() associates monitoring with the Activity’s started, visible lifecycle instead of leaving it registered after the screen has stopped. If the Activity can start and stop repeatedly, this lifecycle pairing also makes it clear where registration belongs.

The example uses the documented Kotlin lambda form and a Toast only to illustrate where app handling can occur. A real app might instead record an in-app event, update relevant UI, or apply a product-specific policy. Do not treat a detected event as proof of malicious behavior: users may take ordinary screenshots, and Android itself supplies a notice for each detection signal.

Rank #4
Sale
Samsung Galaxy S26 Ultra, Unlocked Android Smartphone, 512GB, Black
  • 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

3. Account for platform availability

The callback interface was added in API level 34. An app that supports earlier Android releases should only call the API on devices where it is available; use an SDK-version check around registration and unregistration in a shared Activity implementation. The API reference is the place to verify current availability and signatures: Android Activity reference. Avoid assuming that an Android 14-specific callback provides equivalent behavior on earlier versions.

Choose detection or prevention for the right reason

Screenshot detection and screenshot prevention solve different problems. The callback reports a supported capture event after it occurs. FLAG_SECURE is a window-level control intended to prevent an Activity’s content from appearing in screenshots and on non-secure displays. Android’s reference also states that the callback is not invoked for a monitored Activity window with this flag set. Read the FLAG_SECURE reference alongside the callback documentation before combining the mechanisms.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Tracfone Moto g Play 2024 Prepaid Phone with a 1-Yr Plan Included
  • 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
Mechanism Purpose Behavior Limit to plan for
Activity.ScreenCaptureCallback Detect a supported screenshot of a monitored Activity Invokes app callback; Android presents a system notice No screenshot image is provided; Android 14 supports a particular physical-button path, not ADB or instrumentation test captures.
FLAG_SECURE Protect Activity content from capture Prevents the content from appearing in screenshots and on non-secure displays It is a prevention control, not an event feed; a secure window does not invoke the callback.

Use the callback when your app needs to react to a supported screenshot event. Consider FLAG_SECURE when the requirement is to protect content from the documented capture and display paths. Android suggests considering a setting that lets users control whether the flag is enabled; that can be preferable to imposing a blanket restriction without explaining its effect. Neither mechanism should be represented as a guarantee against every possible way screen content might be copied.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Tell users why a system notice appears

Android presents a system notice for each detection signal. Its feature guide advises developers to explain the feature in context when an Activity using it starts, so the system notice does not surprise people. A short, specific explanation should say that the app can be notified when Android detects a supported screenshot of this screen, and what your app does with that event. Do not imply that the app sees or stores the screenshot unless it actually has a separate, transparent mechanism that does so.

Test the behavior without drawing the wrong conclusion

  1. Check setup first. Confirm the manifest contains DETECT_SCREEN_CAPTURE and that registration happens after the Activity starts, with unregistration in onStop().
  2. Exercise the supported path. On an Android 14 device, take a screenshot using the supported physical hardware-button combination while the monitored Activity is visible. Confirm the callback response and the system notice.
  3. Do not use a test capture as a detection test. An ADB screenshot or instrumentation capture is outside the documented detection path. Not receiving a callback for one of these captures is expected and cannot verify or disprove handling of a supported user screenshot.
  4. Test lifecycle transitions. Start, leave, and return to the Activity, then verify your app registers and unregisters in the intended lifecycle callbacks. This helps catch stale or missing registration independent of the capture mechanism.
  5. Test secure-window behavior separately. If the Activity sets FLAG_SECURE, expect that the screenshot callback will not be invoked for that window. Test the prevention requirement and the detection requirement as separate behaviors.

Troubleshooting common implementation mistakes

  • No callback after an ADB or instrumentation screenshot: those captures are not covered by the Android 14 detection path. Test with the supported physical-button screenshot behavior instead.
  • No callback while another app is on screen: the API is scoped to the Activity registered by your app, not a global screenshot monitor.
  • No callback for a secure Activity: Android documents that a window using FLAG_SECURE does not invoke the callback. Decide whether prevention or event response is the actual requirement.
  • Callback stops after leaving a screen: check that registration is tied to onStart() and that you are not expecting a stopped Activity to keep monitoring.
  • The app expects image bytes or a file: the callback provides no screenshot image. Redesign the response around the event and app-owned screen state rather than attempting to retrieve image contents from this API.
  • Users are surprised by the system notice: explain detection when entering the relevant Activity and state your app’s response plainly.

Or skip the browser setup

Android’s callback is for an Android app monitoring its own Activity. If your separate task is to capture a website from a server, script, or AI workflow, ScreenshotNeo is a website screenshot API and MCP server, not a replacement for Android’s screenshot-detection API. One GET request can return a website screenshot or PDF. The example below follows the ScreenshotNeo API documentation:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo removes cookie banners, popups, and chat widgets before the shot; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up for ScreenshotNeo’s free plan.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Does this API work as a way to monitor screenshots across the whole phone?

No. The callback is registered on an Activity in your app and concerns supported captures of that monitored Activity; it is not a device-wide screenshot feed.

Can my callback save or inspect the screenshot Android detected?

No. Android signals that a supported capture occurred but does not provide the screenshot image to the app.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.