Android Activity Set onCreateSetTheme(Activity activity)

Here you can find the source of onCreateSetTheme(Activity activity)

Description

Set the theme of the activity, according to the configuration.

License

Open Source License

Declaration

public static void onCreateSetTheme(Activity activity) 

Method Source Code

//package com.java2s;
/**//from   w w  w  .ja  v  a  2  s. c  o m
 * This file is part of C.T.M.Droid.
 *
 * C.T.M.Droid is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * C.T.M.Droid is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with C.T.M.Droid.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */

import android.app.Activity;

public class Main {
    private static int cTheme;
    public final static int THEME_DEFAULT = 0;
    public final static int THEME_WHITE = 1;
    public final static int THEME_BLACK = 2;

    /** Set the theme of the activity, according to the configuration. */
    public static void onCreateSetTheme(Activity activity) {
        switch (cTheme) {
        default:
        case THEME_DEFAULT:
            break;
        case THEME_WHITE:
            activity.setTheme(android.R.style.Theme_Light_NoTitleBar);
            break;
        case THEME_BLACK:
            activity.setTheme(android.R.style.Theme_Black_NoTitleBar);
            break;
        }
    }
}

Related

  1. setDisplayHomeAsUpEnabled(Activity a, boolean enabled)
  2. setNavigationSelected(Activity activity, ArrayAdapter adapter, String selected)
  3. setNavigationList(Activity activity, SpinnerAdapter adapter, ActionBar.OnNavigationListener listener)
  4. setDisplayHomeAsUpEnabled(Activity activity, boolean b)
  5. setDisplayHomeAsUpEnabled(Activity activity, boolean b)
  6. addView(Activity act, View v, Rect rect)
  7. enableHardwareAccelerate(Activity activity)