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 {
    public static int getRelativeLeft(View myView) {
        //       if (myView.getParent() == myView.getRootView())
        if (myView.getId() == android.R.id.content) {
            return myView.getLeft();
        } else {
            return myView.getLeft() + getRelativeLeft((View) myView.getParent());
        }
    }
}