Summary of several methods for Android screenshots

Android screenshot

Principle of Android screen capture: obtain the bitmap of the specific area to be screenshot, draw it on the canvas, save it as a picture and share it or use it for other purposes

1、 Activity screenshot

1. Activity interface (including blank status bar)

2. Cut off the activity interface (remove the status bar)

2、 View screenshot

3、 Screenshot of Scrollview: Scrollview has only one childview. Although not all of them are displayed on the interface, they have been rendered and drawn. Therefore, you can directly call scrollview.draw (canvas) to complete the screenshot

4、 Screenshot of listview: listview is an ItemView that recycles and reuses items and only draws them on the screen. The following method uses a list to store the view of items. This scheme is still not good enough. Oom may occur when there are enough items.

5、 Recycleview screenshot

6、 WebView screenshot

1. Capture a screenshot of the visible area of WebView

2. Intercept the entire page of WebView

3. Intercept the mobile phone screen and obtain the WebView displayed on the interface

Thank you for reading, hope to help you, thank you for your support to this site!

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
分享
二维码
< <上一篇
下一篇>>