get Window Visible Display Frame - Android User Interface

Android examples for User Interface:Window

Description

get Window Visible Display Frame

Demo Code


//package com.java2s;

import android.app.Activity;

import android.graphics.Rect;

public class Main {
    public static Rect getWindowVisibleDisplayFrame(Activity activity) {
        Rect frame = new Rect();
        activity.getWindow().getDecorView()
                .getWindowVisibleDisplayFrame(frame);
        return frame;
    }//from   w  w  w .  j a v a2  s  . co m
}

Related Tutorials