public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
String string = "屏幕分辨率为:"+displayMetrics.widthPixels+"×"+displayMetrics.heightPixels;
textView = (TextView) findViewById(R.id.textView1);
textView.setText(string);
}