get View Location In Window - Android User Interface

Android examples for User Interface:View Position

Description

get View Location In Window

Demo Code


//package com.java2s;

import android.view.View;

public class Main {

    public static int[] getLocationInWindow(View view) {
        int[] location = new int[2];
        view.getLocationInWindow(location);
        return location;
    }/*from  ww w  .  j  a  v a  2s.com*/
}

Related Tutorials