0

From android 4.0+, it supports to take screenshot by pressing volumn down+power keys. I'm going to use the screenshot image immediately when after taking screenshot by the hotkey.

Is there any Android SDK API to be used as a callback of the event? then I can register such listener to the event of taking screenshot.

Will taking screenshot by vol down+power send some public broadcast? then I can receive this public broadcast.

Is there any way to capture hotkey events? When pressing volumn down+power at the same time, can I get a notification?

tshepang
  • 12,111
  • 21
  • 91
  • 136
lseeo
  • 799
  • 2
  • 9
  • 15

1 Answers1

0

Is there any Android SDK API to be used as a callback of the event?

Not specifically. You could try listening for events related generally to changes in available image content (e.g., a ContentResolver on MediaStore), but that will cover other things, such as pictures taken by the camera.

Is there any way to capture hotkey events?

You are welcome to see if onKeyDown() of a foreground activity hears about this event, though I doubt it. And if your activity is not in the foreground, you definitely cannot hear about this event.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • I guess this kind of operation should send broadcast, do you know about it? I tried to listen for changes on screenshot directory on sdcard, but not know how to monitor MediaStore and ContentResolver. Could you explain more clearly? thank you very much – lseeo May 23 '13 at 05:59
  • @user1693380: "I guess this kind of operation should send broadcast, do you know about it?" -- I am not aware of a broadcast for a screenshot. "but not know how to monitor MediaStore and ContentResolver" -- http://stackoverflow.com/questions/9116693/how-can-i-tell-when-an-album-is-added-to-the-mediastore http://stackoverflow.com/questions/230643/android-api-for-detecting-new-media-from-inbuilt-camera-mic – CommonsWare May 23 '13 at 06:58