有没有办法以编程方式获得显示刷新率?

Ngu*_*inh 11 android

作为标题,我想获得Android手机的刷新率然后显示给用户.有什么办法吗?

更新:什么是刷新率? http://en.m.wikipedia.org/wiki/Refresh_rate

Ngu*_*inh 21

解决方案是:

Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
float refreshRating = display.getRefreshRate();
Run Code Online (Sandbox Code Playgroud)

感谢THelper.