Android Open Source - DailySelfie Alarm Setter






From Project

Back to project page DailySelfie.

License

The source code is released under:

Apache License

If you think the Android project DailySelfie 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 it.lusio.android.dailyselfie.alarm;
//ww  w .  ja  v a  2  s . c o  m
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;

public class AlarmSetter {
    private static final int PENDING_INTENT_ID = 0;
    private static final long REPEAT_TIME = 2 * 60 * 1000;
    private Context mContext;
    private PendingIntent mPendingIntent;

    public AlarmSetter(Context context) {
        this.mContext = context;
    }

    public void startAlarm() {
        mPendingIntent = PendingIntent.getBroadcast(mContext, PENDING_INTENT_ID, new Intent(mContext, AlarmReceiver.class), PendingIntent.FLAG_UPDATE_CURRENT);
        AlarmManager alarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE);
        alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, REPEAT_TIME, REPEAT_TIME, mPendingIntent);
    }
}




Java Source Code List

it.lusio.android.dailyselfie.ApplicationDailySelfie.java
it.lusio.android.dailyselfie.ApplicationTest.java
it.lusio.android.dailyselfie.Constants.java
it.lusio.android.dailyselfie.alarm.AlarmReceiver.java
it.lusio.android.dailyselfie.alarm.AlarmSetter.java
it.lusio.android.dailyselfie.ui.ActivityImageViewer.java
it.lusio.android.dailyselfie.ui.ActivityMain.java
it.lusio.android.dailyselfie.ui.AdapterGridView.java
it.lusio.android.dailyselfie.ui.Selfie.java
it.lusio.android.dailyselfie.ui.SquareImageView.java