Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.graphics.Point;

import android.view.View;

public class Main {
    public static Point getCenter(View v) {
        Point point = new Point();
        point.x = (int) (v.getX() + (v.getMeasuredWidth() / 2));
        point.y = (int) (v.getY() + (v.getMeasuredHeight() / 2));
        return point;
    }
}