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 android.app.Activity;
import android.os.Build;
import android.view.Window;

public class Main {
    /**
     * Hides the activity's action bar
     *
     * @param activity
     *     the activity
     */
    public static void hideActionBar(Activity activity) {
        // Call before calling setContentView();
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && activity != null) {
            activity.getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
            activity.getActionBar().hide();
        }
    }
}