FileDocCategorySizeDatePackage
Display.javaAPI DocAndroid 1.5 API3289Wed May 06 22:41:56 BST 2009android.view

Display

public class Display extends Object

Fields Summary
public static final int
DEFAULT_DISPLAY
Specify the default Display
private int
mDisplay
private int
mPixelFormat
private float
mRefreshRate
private float
mDensity
private float
mDpiX
private float
mDpiY
private static final Object
mStaticInit
private static boolean
mInitialized
Constructors Summary
Display(int display)
Use the WindowManager interface to create a Display object. Display gives you access to some information about a particular display connected to the device.


    
                                 
      
        // initalize the statics when this class is first instansiated. This is
        // done here instead of in the static block because Zygote
        synchronized (mStaticInit) {
            if (!mInitialized) {
                nativeClassInit();
                mInitialized = true;
            }
        }
        mDisplay = display;
        init(display);
    
Methods Summary
static native intgetDisplayCount()

return
the number of displays connected to the device.

public intgetDisplayId()

return
index of this display.

        return mDisplay;
    
public native intgetHeight()

return
height of this display in pixels.

public voidgetMetrics(android.util.DisplayMetrics outMetrics)
Initialize a DisplayMetrics object from this display's data.

param
outMetrics

        outMetrics.widthPixels  = getWidth();
        outMetrics.heightPixels = getHeight();
        outMetrics.density      = mDensity;
        outMetrics.scaledDensity= outMetrics.density;
        outMetrics.xdpi         = mDpiX;
        outMetrics.ydpi         = mDpiY;
    
public native intgetOrientation()

return
orientation of this display.

public intgetPixelFormat()

return
pixel format of this display.

        return mPixelFormat;
    
public floatgetRefreshRate()

return
refresh rate of this display in frames per second.

        return mRefreshRate;
    
public native intgetWidth()

return
width of this display in pixels.

private native voidinit(int display)

private static native voidnativeClassInit()