Android Open Source - whatcolourisit What Colour Is It Activity






From Project

Back to project page whatcolourisit.

License

The source code is released under:

Apache License

If you think the Android project whatcolourisit 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.oe.app.whatcolourisit;
//from  w w w  .jav a 2s  . c om
/*
Copyright 2014 minhnt@ownego.com
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
 */

import android.app.Activity;
import android.app.WallpaperManager;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;

public class WhatColourIsItActivity extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    
    initWallpaper();
  }
  
  public void initWallpaper() {
    Intent intent = new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER);
    intent.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT,
        new ComponentName(this, WhatColourIsItService.class));
    startActivityForResult(intent, 111);
  }
  
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // TODO Auto-generated method stub
    super.onActivityResult(requestCode, resultCode, data);
    
    finish();
  }
}




Java Source Code List

com.oe.app.whatcolourisit.WhatColourIsItActivity.java
com.oe.app.whatcolourisit.WhatColourIsItService.java