I\'m making an alarm receiver, but the alarm is not triggered.
This is my code :
Start alarm in MainActivity :
private void setupAlarm(){
In
Try To Use THis. It will Work for you
private void setupAlarm(){
Intent intent = new Intent(this, com.logdata.AlarmReceiver.class);
PendingIntent pIntent = PendingIntent.getBroadcast(this, 0, intent, 0);
AlarmManager manager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
manager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,SystemClock.elapsedRealtime() + 1, 1000, pIntent);
Log.e("setupAlarm", "Setup alarm complete");
}