Android Open Source - ACG Utils






From Project

Back to project page ACG.

License

The source code is released under:

Dit werk (de broncode) mag niet gekopieerd of aangepast worden voor enig doel zonder het contacteren van de maker. Voor vragen of opmerkingen, neem contact op met Bas Verhoog.

If you think the Android project ACG listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package bas.sie.Antonius;
/*  w  ww  .ja va 2s . c o m*/
import android.app.Activity;
import android.content.Intent;

public class Utils
{
  private static int sTheme;

  public final static int THEME_DEFAULT = 0;
  public final static int THEME_SHERLOCK_LIGHT = 1;
  public final static int THEME_SHERLOCK = 2;

  /**
   * Set the theme of the Activity, and restart it by creating a new Activity
   * of the same type.
   */
  public static void changeToTheme(Activity activity, int theme)
  {
    sTheme = theme;
    activity.finish();

    activity.startActivity(new Intent(activity, activity.getClass()));
  }

  /** Set the theme of the activity, according to the configuration. */
  public static void onActivityCreateSetTheme(Activity activity)
  {
    switch (sTheme)
    {
    default:
    case THEME_DEFAULT:
      break;
    case THEME_SHERLOCK_LIGHT:
      activity.setTheme(R.style.Theme_Sherlock_Light);
      break;
    case THEME_SHERLOCK:
      activity.setTheme(R.style.Theme_Sherlock);
      break;
    }
  }
}




Java Source Code List

bas.sie.Antonius.About.java
bas.sie.Antonius.AntoniusActivity.java
bas.sie.Antonius.ChangeLog.java
bas.sie.Antonius.Contact.java
bas.sie.Antonius.External.java
bas.sie.Antonius.FacebookDialog.java
bas.sie.Antonius.Home.java
bas.sie.Antonius.MyWebView.java
bas.sie.Antonius.SQLiteAdapter.java
bas.sie.Antonius.Screensaver.java
bas.sie.Antonius.Settings.java
bas.sie.Antonius.TeacherInfo.java
bas.sie.Antonius.TwitterDialog.java
bas.sie.Antonius.Utils.java