I change the Android emulator 2.2 resolution to WVGA800. But when I tried to get the width and height, it was still 320 x 533. I tried another application using the surfaceview, and it changed to 480 x 800. Why? It confused me. Did I make any mistake in the code or the setting. Thanks for your helping.
public class Mytest extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
DisplayMetrics dm=getResources().getDisplayMetrics();
int screenWidth=dm.widthPixels;
int screenHeight=dm.heightPixels;
this.setTitle("X="+screenWidth+", Y="+screenHeight);
setContentView(R.layout.main);
}
}