super.onCreate(icicle);
setContentView(R.layout.display);
mFontSize = (Spinner) findViewById(R.id.fontSize);
mFontSize.setOnItemSelectedListener(mFontSizeChanged);
String[] states = new String[3];
Resources r = getResources();
states[0] = r.getString(R.string.small_font);
states[1] = r.getString(R.string.medium_font);
states[2] = r.getString(R.string.large_font);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, states);
adapter.setDropDownViewResource(
android.R.layout.simple_spinner_dropdown_item);
mFontSize.setAdapter(adapter);
mPreview = (TextView) findViewById(R.id.preview);
mPreview.setText(r.getText(R.string.font_size_preview_text));
Button save = (Button) findViewById(R.id.save);
save.setText(r.getText(R.string.font_size_save));
save.setOnClickListener(this);
mTextSizeTyped = new TypedValue();
TypedArray styledAttributes =
obtainStyledAttributes(android.R.styleable.TextView);
styledAttributes.getValue(android.R.styleable.TextView_textSize,
mTextSizeTyped);
DisplayMetrics metrics = getResources().getDisplayMetrics();
mDisplayMetrics = new DisplayMetrics();
mDisplayMetrics.density = metrics.density;
mDisplayMetrics.heightPixels = metrics.heightPixels;
mDisplayMetrics.scaledDensity = metrics.scaledDensity;
mDisplayMetrics.widthPixels = metrics.widthPixels;
mDisplayMetrics.xdpi = metrics.xdpi;
mDisplayMetrics.ydpi = metrics.ydpi;
styledAttributes.recycle();