Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.view.View;
import android.view.ViewGroup;

public class Main {
    public static ViewGroup getParent(View v, int parentId) {
        ViewGroup p = (ViewGroup) v.getParent();
        while (true) {
            if (p == null) {
                return null;
            }
            if (p.getId() == parentId) {
                return p;
            }
            p = (ViewGroup) p.getParent();
        }
    }
}