Android screenshot function implementation code

In Android development, the getdrawingcache method of view can achieve the purpose of screen capture, but the status bar is missing!

Original interface

Screenshot image

code implementation

1. Add permissions (in the androidmanifest.xml file)

2. Add a button (activity_main. XML file)

3. Screen capture (mainactivity. Java file)

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>