Reputation: 680
I am wondering what is the period of calling for the method OnDraw of a SurfaceView. Does it depends on the device?
For example, Is this method call 32, 24 or 16 times per second?
thank you all!
Upvotes: 1
Views: 506
Reputation: 6557
Android will call onDraw()
method of a view class ( e.g SurfaceView) each time the view needs to be refreshed. The number of times a view gets refreshed depends on the Refresh Rate
of the device.
You can use getRefreshRate()
to get the refresh rate of the display in frames per second.
Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
int refreshRate = display.getRefreshRate();
Upvotes: 2