Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.view.View;
import java.lang.reflect.Field;

public class Main {
    public static int getSystemUiFlagLayoutStableValue(Class<View> object) {
        return getConstantValue(object, "SYSTEM_UI_FLAG_LAYOUT_STABLE");
    }

    public static int getConstantValue(Class<View> object, String constantName) {
        int value = -1;
        try {
            Field field = object.getField(constantName);
            value = field.getInt(object);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return value;
    }
}