Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Mozilla Public License 

import android.app.Activity;

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

public class Main {
    /**
     * getContentView from an activity
     * @param activity
     * @return View
     */
    public static View getContentView(Activity activity) {
        ViewGroup view = (ViewGroup) activity.getWindow().getDecorView();
        ViewGroup content = (ViewGroup) view.findViewById(android.R.id.content);
        return content.getChildAt(0);
    }
}