get Scene Root - Android User Interface

Android examples for User Interface:View Parent

Description

get Scene Root

Demo Code


//package com.java2s;

import android.app.Activity;

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

public class Main {

    public static View getSceneRoot(Activity destActivity) {
        return ((ViewGroup) destActivity.getWindow().getDecorView())
                .getChildAt(0);/*w w  w  .j  a  v a 2  s .c  o m*/
    }
}

Related Tutorials