Display.getRefreshRate () gives me different values ​​on different devices

I use Display.getRefreshRate () to get the refresh rate of my display. The X10 Mini returns a value of 0.325. In Galaxy S, this value is 68.0. That makes no sense to me. Any ideas?

+4
source share
1 answer

This seems to be a mistake, although I did not find any error reports for it. The number I get is also ~ 0.34, while I was expecting something like 60. I was not able to find a meaningful interpretation of 0.34 regarding refreshrates, and so my solution was simply to β€œreject my truth and replace my own "following code:

public float getRefreshRate() { final WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE); final Display display = wm.getDefaultDisplay(); float rate = display.getRefreshRate(); if (rate < 10.0f) { rate = 60.0f; //Default to something which seems to be a normal refreshrate on many phones } return rate; } 

This works great in my application. Hope this was helpful!

+1
source

All Articles