Here you can find the source of getBounds(Display d, Rect r)
protected static Rect getBounds(Display d, Rect r)
//package com.java2s; import android.graphics.Rect; import android.view.Display; public class Main { protected static Rect getBounds(Display d, Rect r) { return new Rect(r.left, r.top, d.getWidth() - r.right, d.getHeight() - r.bottom); }//from ww w. j av a 2s . c om }