3

Is there any way i can detect in my service when user takes screenshot of his android device?

The basic idea is whenever user takes screenshot of his device a popup will be displayed asking user to upload image to facebook, twitter etc.

Badal
  • 3,287
  • 4
  • 29
  • 58
  • I assume that you are the one that make that service. Do you put the screenshot on a `Bitmap` object? Can you please help us by some chunk of codes? – didityedi Feb 19 '13 at 07:00

1 Answers1

4

This is untested, but you may want to try the FileObserver class.

Point it at the screenshots folder and wait for a CREATE event.

https://developer.android.com/reference/android/os/FileObserver.html

alex
  • 6,099
  • 1
  • 21
  • 21
  • Just FYI I think file observers will work but some versions are buggy with it like android 6.0 https://stackoverflow.com/questions/36237314/fileobserver-and-contentobserver-not-working-in-android-marshmallow – Bqin1 Aug 09 '17 at 03:17