for example i want to have an alarm that will fire every sunday at noon.... how would i do this?
finally this right solution if set as (sun,tus ,fri) you must create three alarm for these three day the following code set alarm every sunday and send dayOfWeek=1;
public void setAlarm_sun(int dayOfWeek) {
cal1.set(Calendar.DAY_OF_WEEK, dayOfWeek);
Toast.makeText(getApplicationContext(), "sun "+cal1.get(Calendar.DAY_OF_WEEK), 222).show();
Toast.makeText(getApplicationContext(), "Finsh", 222).show();
Intent intent = new Intent(this, SecActivity.class);
PendingIntent pendingIntent0 = PendingIntent.getBroadcast(this, 0,
intent, 0);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 12345,
intent, PendingIntent.FLAG_UPDATE_CURRENT);
Long alarmTime = cal1.getTimeInMillis();
AlarmManager am = (AlarmManager) getSystemService(Activity.ALARM_SERVICE);
// am.setRepeating(AlarmManager.RTC_WAKEUP, alarmTime,7* 24 * 60 * 60 * 1000 , pendingIntent);
am.setRepeating(AlarmManager.RTC_WAKEUP, alarmTime,7* 24 * 60 * 60 * 1000 , pendingIntent);
}