Android examples for User Interface:View Center
get View Center X Y
//package com.java2s; import android.view.View; public class Main { public static float[] getCenterXY(View view) { final float[] center = new float[2]; center[0] = view.getX() + view.getWidth() / 2; center[1] = view.getY() + view.getHeight() / 2; return center; }//from w w w . j a v a 2s . c om }