How to take a screenshot and share it programmatically

后端 未结 5 869
半阙折子戏
半阙折子戏 2020-12-02 05:40

I am making an application in Android in which I have to take screenshot of one of my activities and mail it as attachment.

I want to take screenshot of the current

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-02 06:10

    If by "screenshot of current page" you mean "screenshot of one of my activities", you can arrange to render your Views to a bitmap-backed Canvas, then save an image from the bitmap.

    If by "screenshot of current page" you mean "screenshot of somebody else's activity", that is not supported by the Android SDK, for obvious privacy and security reasons. There are various techniques that rooted device users can use to take screenshots.

提交回复
热议问题