标签:android sp c on r ef new bs window
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
final EditText et=(EditText)this.findViewById(R.id.EditText01);//EditText对象
final EditText ett=(EditText)this.findViewById(R.id.EditText02);//EditText对象
Button ok=(Button)this.findViewById(R.id.Button01);//按钮对象
ok.setOnClickListener
(
new OnClickListener()
{
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
et.setText(dm.heightPixels+"");
ett.setText(dm.widthPixels+"");
}
}
);
}
标签:android sp c on r ef new bs window
原文地址:http://www.cnblogs.com/shijiaoyun/p/4001359.html