Possible Duplicate:
how to take snapshot of screen programmatically?
As part of building my new app, I would like to allow the user to take a screenshot of the device using a button in my app. However I need this done without rooting of the device, using native API.
I was trying to look for references and android developer site, but couldn't find the native API functionality to do the above.
Can you please confirm that it is indeed possible to do the above (Taking a screenshot programmatically)? Can you please also direct me to somewhere I can see the API at?
Try this code:
Add permission too:
XML for this will be: