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 java.lang.reflect.Field;
import java.lang.reflect.Method;

import android.view.View;

public class Main {
    static boolean setSystemUiVisibility(View view, String flagName) {
        try {
            Method setUiMethod = View.class.getMethod("setSystemUiVisibility", int.class);
            Field flagField = View.class.getField(flagName);
            setUiMethod.invoke(view, flagField.get(null));
            return true;
        } catch (Exception ex) {
            return false;
        }
    }
}