Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.view.View;

public class Main {
    private static int[] getCenterOf(View view) {
        int[] loc = new int[2];
        view.getLocationOnScreen(loc);
        loc[0] += (view.getWidth() / 2); //middle of button
        loc[1] += (view.getHeight() / 2); //middle of button
        return loc;
    }
}