Wednesday, November 14, 2012

How to get windows width and height in ANDROID


private static Point getDisplaySize(final Display display) {
    final Point point = new Point();
    try {
        display.getSize(point);
    } catch (java.lang.NoSuchMethodError ignore) { // Older device
        point.x = display.getWidth();
        point.y = display.getHeight();
    }
    return point;
}
Its helpful, this code we can use for older and newer devices.
I used in my circular list project.
From this page:
http://stackoverflow.com/questions/9654016/getsize-giving-me-errors

No comments:

Post a Comment