Android Question Screenshots with MediaProjection library


Active Member
Licensed User
Longtime User

I'm busy developing an app that should be similar to this:

Screenshots of any screen display are taken. In this forum I found a solution that creates these screenshots using the MediaProjection library:

Unfortunately there is a problem that I cannot solve. With my Android smartphones I can take around 30 pictures. The smartphone becomes increasingly difficult to use until it restarts completely. This problem is already discussed in the forum thread. Unfortunately I can only look at the attached source code. Unfortunately I don't understand the content. I was only able to determine for myself that after the first screenshot, the total free memory went down from 128 MB to 2.5 MB. This value remains in the following screenshots.

Without support from this forum, the problem will probably remain unsolvable for me. I would be very grateful if there was a solution.