L
L
Listrigon2018-10-17 16:27:00
Android
Listrigon, 2018-10-17 16:27:00

How to programmatically take a screenshot in Android?

I could not find anywhere a seemingly simple Java code snippet for Android that would take a screenshot of the entire screen, i.e. we need a method without parameters, returning a byte array of the screenshot.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg, 2018-10-17
@Listrigon

https://github.com/googlesamples/android-screencapture

N
nictic123, 2018-10-20
@nictic123

For most manufacturers, press the lock button and volume
down at the same time On Samsung, press the physical home button and volume down at the same time.
For some manufacturers, you can also press and hold the recent applications button, or take a screenshot from the device’s power menu (2-3 seconds hold the lock button)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question