I\'m trying to give the user a notification each day on a certain time so I use an AlarmManager with a notification. I have this:
public void check_products(
Call receiver in your manifest file.
Like this
Or
Try this whole example
MainActivity.java
private PendingIntent pendingIntent;
Intent intent = new Intent(MainActivity.this, AlarmReceiver.class);
pendingIntent = PendingIntent.getBroadcast(MainActivity.this, 0, intent , 0);
AlarmManager littlefluppy = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
littlefluppy.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), 2000, pendingIntent);
AlarmReceiver.java
public class AlarmReceiver extends BroadcastReceiver {
public AlarmReceiver() {
}
@Override
public void onReceive(Context context, Intent intent) {
// TODO: This method is called when the BroadcastReceiver is receiving
// an Intent broadcast.
Log.e("alram set.....","");
}
}