Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strange graphics artefacts in Android app

I'm intermittently observing strange graphics artefacts in my app, as shown below. This is a screengrab from a Samsung Galaxy S3. I have only observed it on this particular phone. I have run the app on a Samsung Galaxy Tab S4 and an HTC One, and never observed this issue on either - although admittedly I do mainly use the S3 for development.

I considered that the issue might be some sort of concurrency clash in drawing to the Canvas (I'm using the basic Android rendering methods, no OpenGL or anything), since I can clearly recognise the repeating units of other UI elements, so I synchronized all the code which draws to or interacts with the Canvas and I'm still observing it happen.

It does clear itself up after around 30-90 seconds, which may be due to a regular scheduled memory cleanup operation it performs - so perhaps this is a manifestation of low available mem?

If I had enough rep I would stick a pretty big bounty on this. Any help appreciated. Hopefully someone recognises this particular problem.

Strange graphics artefacts

like image 941
HomerPlata Avatar asked Oct 30 '22 14:10

HomerPlata


1 Answers

Apply hardware layers:

setLayerType(View.LAYER_TYPE_HARDWARE, null);
like image 124
azizbekian Avatar answered Nov 09 '22 17:11

azizbekian