Android Open Source - AndroidRandomWallpaper Alarm Receiver






From Project

Back to project page AndroidRandomWallpaper.

License

The source code is released under:

GNU General Public License

If you think the Android project AndroidRandomWallpaper 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.elbauldelprogramador.randomwallpaper.reveivers;
/* ww  w. j a va2 s  .  c  o m*/
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import com.elbauldelprogramador.randomwallpaper.Service;
import com.elbauldelprogramador.randomwallpaper.activities.MainActivity;

public class AlarmReceiver extends BroadcastReceiver{
  
  public static String ACTION_CHANGE_WALL_ALARM = 
      "com.elbauldelprogramador.com.randomwallpaper.alarm";
  
  @Override
  public void onReceive(Context context, Intent intent) {
    
    Log.i(MainActivity.TAG, "Alarm intent received");
    
    Bundle bundle = intent.getExtras();
    String action = bundle.getString(ACTION_CHANGE_WALL_ALARM);
    
    if (action.equals(ACTION_CHANGE_WALL_ALARM)) {
      Log.d(MainActivity.TAG, "AlarmReceiver: starting service...");
      Intent inService = new Intent(context,Service.class);
      inService.putExtras(bundle);
      context.startService(inService);
    }
    else
      Log.d(MainActivity.TAG, "AlarmReceiver: no action");
  }

}




Java Source Code List

com.elbauldelprogramador.randomwallpaper.Service.java
com.elbauldelprogramador.randomwallpaper.activities.AboutTheApp.java
com.elbauldelprogramador.randomwallpaper.activities.MainActivity.java
com.elbauldelprogramador.randomwallpaper.reveivers.AlarmReceiver.java
com.elbauldelprogramador.randomwallpaper.reveivers.OnBootReceiver.java
com.elbauldelprogramador.randomwallpaper.util.RWGlobal.java
com.elbauldelprogramador.randomwallpaper.util.SimpleFileExplorer.java
com.elbauldelprogramador.randomwallpaper.util.StrictModeWrapper.java