GPU hardware acceleration related problems, solve flash screen

In Android development, some models may experience a flash screen problem when using alpha animation with a transparent background. This problem should only be added in the current Activity configuration

android:hardwareAccelerated="true"

This will solve it. Why is that?

In my opinion, the reasons may be as follows:
In general, the frame rate of the GPU should be higher than the refresh rate so that it does not stall or drop frames. If the screen refresh rate is faster than the frame rate, the screen will show the same picture in two frames. When this intermittent situation continues, the user will obviously feel the animation lag or frame drop, and then return to normal, which is often referred to as flash screen, frame skip, lag.

Of course, if you put this code in the application, it will report an error on some Samsung phones

Read More: