get View Layer Type - Android User Interface

Android examples for User Interface:View Layer

Description

get View Layer Type

Demo Code


//package com.java2s;

import java.lang.reflect.Method;

import android.view.View;

public class Main {
    public static final int LAYER_TYPE_NONE = 0;
    private static Method methodGetLayerType = null;

    static public int getLayerType(View view) {
        if (methodGetLayerType != null) {
            try {
                Object result = methodGetLayerType.invoke(view);
                return (Integer) result;
            } catch (Throwable t) {
                t.printStackTrace();/*  w w w. jav a  2 s . com*/
            }
        }
        return LAYER_TYPE_NONE;
    }
}

Related Tutorials