[Android] Simplify WindowManager retrieval within RefreshRateSetOS.java. Also simplified the conversion of a double to a String.

No need to first turn the double into the object Double. Double has a toString() method for this.
This commit is contained in:
Lioncash 2013-10-08 23:33:00 -04:00
parent ac2c9840ff
commit 73f97281fe

View File

@ -17,12 +17,12 @@ public final class RefreshRateSetOS extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
final WindowManager wm = getWindowManager();
final Display display = wm.getDefaultDisplay();
double rate = display.getRefreshRate();
SharedPreferences prefs = UserPreferences.getPreferences(this);
SharedPreferences.Editor edit = prefs.edit();
edit.putString("video_refresh_rate", Double.valueOf(rate).toString());
edit.putString("video_refresh_rate", Double.toString(rate));
edit.commit();
Toast.makeText(this, String.format(getString(R.string.using_os_reported_refresh_rate), rate), Toast.LENGTH_LONG).show();