Java tutorial
//package com.java2s; import android.graphics.Rect; import android.graphics.RectF; public class Main { public static Rect rect(final RectF rect) { return new Rect((int) rect.left, (int) rect.top, (int) rect.right, (int) rect.bottom); } }