Here you can find the source of setLayoutParams(View cover, Display display)
public static void setLayoutParams(View cover, Display display)
//package com.java2s; import android.graphics.Point; import android.view.Display; import android.view.View; import android.widget.RelativeLayout.LayoutParams; public class Main { public static void setLayoutParams(View cover, Display display) { Point size = getDisplaySize(display); int width = size.x; int height = size.y; cover.setLayoutParams(new LayoutParams(width, height)); cover.setY((float) width); }/*from ww w.j a v a 2 s . c om*/ public static Point getDisplaySize(Display display) { Point size = new Point(); display.getSize(size); return size; } }