Android Open Source - ColorWallpaper Launcher Activity






From Project

Back to project page ColorWallpaper.

License

The source code is released under:

Licensed under the Expat License. Copyright (C) 2013 Peter Occil Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the...

If you think the Android project ColorWallpaper 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 com.upokecenter.android.colorwallpaper;
//from   w w  w.  j  ava  2 s .c o  m
import android.app.Activity;
import android.app.WallpaperManager;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;

import com.upokecenter.android.ui.DialogUtility;
import com.upokecenter.android.ui.IChoiceListener;
import com.upokecenter.android.util.AppManager;

public class LauncherActivity extends Activity {

  @Override
  public void onDestroy(){
    super.onDestroy();
    DialogUtility.clean();
  }

  @Override
  public void onCreate(Bundle b){
    super.onCreate(b);
    AppManager.initialize(this);
    DialogUtility.showChoices(this,R.string.app_name,
        (Build.VERSION.SDK_INT>=Build.VERSION_CODES.JELLY_BEAN) ?
            R.array.entries_launcher_jellybean :
              R.array.entries_launcher,
              new IChoiceListener(){
      @Override
      public void onChoice(int choice){
        if(choice==0){ // Settings
          Intent intent=new Intent(Intent.ACTION_MAIN);
          intent.setClass(AppManager.getApplication(),SettingsActivity.class);
          startActivity(intent);
        }
        if(choice==1){ // Show Live Wallpapers or Set Live Wallpaper
          Intent intent=null;
          if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.JELLY_BEAN){
            intent=new Intent("android.service.wallpaper.CHANGE_LIVE_WALLPAPER");
            intent.putExtra("android.service.wallpaper.extra.LIVE_WALLPAPER_COMPONENT",
                new ComponentName(AppManager.getApplication(),ColorWallpaperService.class));
          } else {
            intent=new Intent(WallpaperManager.ACTION_LIVE_WALLPAPER_CHOOSER);
          }
          startActivity(intent);
        }
        finish();
      }
    });
  }
}




Java Source Code List

com.upokecenter.android.colorwallpaper.ColorWallpaperService.java
com.upokecenter.android.colorwallpaper.LauncherActivity.java
com.upokecenter.android.colorwallpaper.SettingsActivity.java
com.upokecenter.android.location.DummyLocationHelper.java
com.upokecenter.android.location.ILocationHelper.java
com.upokecenter.android.location.ISimpleLocationListener.java
com.upokecenter.android.location.LocationHelper.java
com.upokecenter.android.net.ConnectivityHelper.java
com.upokecenter.android.net.DownloadService.java
com.upokecenter.android.net.IConnectionListener.java
com.upokecenter.android.ui.AlertDialogActivity.java
com.upokecenter.android.ui.AlertDialogPreference.java
com.upokecenter.android.ui.BaseSettingsActivity.java
com.upokecenter.android.ui.ChoosePicturePreference.java
com.upokecenter.android.ui.ColorPickerDialog.java
com.upokecenter.android.ui.ContinuousValuePreference.java
com.upokecenter.android.ui.DialogUtility.java
com.upokecenter.android.ui.GetContentActivity.java
com.upokecenter.android.ui.IChoiceListener.java
com.upokecenter.android.ui.IDialogUpdater.java
com.upokecenter.android.ui.IntentPreference.java
com.upokecenter.android.ui.PreferenceState.java
com.upokecenter.android.ui.ShareActivity.java
com.upokecenter.android.ui.UriPreference.java
com.upokecenter.android.util.AppManager.java
com.upokecenter.android.util.BitmapUtility.java
com.upokecenter.android.util.StorageUtility.java
com.upokecenter.android.wallpaper.BaseWallpaperService.java
com.upokecenter.util.XmlHelper.java