开发者

Android emulator resolution setting is not working

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.开发者_Go百科setTitle("X="+screenWidth+", Y="+screenHeight);
    setContentView(R.layout.main);
}
}


You are getting the pixels after division by pixel density. Peep this hot action: Android: Showing wrong screen resolution

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜