get View Location On Screen - Android User Interface

Android examples for User Interface:View Position

Description

get View Location On Screen

Demo Code


//package com.java2s;

import android.view.View;

public class Main {

    public static int[] getLocationOnScreen(View view) {
        int[] location = new int[2];
        view.getLocationOnScreen(location);
        return location;
    }//from   ww w  .j av  a2 s  . c o  m
}

Related Tutorials