Thursday, February 24, 2011

How to programmatically figure out the screen resolution?

By Magesh Kumar   Posted at  3:57 AM   Android 1 comment


This code will give you the screen resolution at run time.
The size of your application may differ due to the status and title bar.
@Override
public void onCreate(Bundle icicle) {
 WindowManager w = getWindowManager();
 Display d = w.getDefaultDisplay();

 int width = d.getWidth();
 int height = d.getHeight();
}


About the Author

Nulla sagittis convallis arcu. Sed sed nunc. Curabitur consequat. Quisque metus enim, venenatis fermentum, mollis in, porta et, nibh. Duis vulputate elit in elit. Mauris dictum libero id justo.
View all posts by: BT9

1 comment:

Back to top ↑
Connect with Us

What they says

© 2013 MaGeSH 2 help. WP Mythemeshop Converted by BloggerTheme9
Blogger templates. Proudly Powered by Blogger.