AlarmManager setInexactRepeating, setWindow, setRepeating methods do not fire alarm when called from within loop for week days
try this code its working for Friday Alarm and similarly you can set for Saturday First you have to register your alarm Receiver and alarm time
public static void SetAlarmForFriday(Context mContext) {
try {
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY);
System.out.println("Date " + calendar.getTime());
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH) + 1;
int day = calendar.get(Calendar.DAY_OF_MONTH);
String DateToConvert = day + "," + month + "," + year + " 10:10 AM";
Date date = new SimpleDateFormat("dd,MM,yyyy hh:mm a", Locale.ENGLISH).parse(DateToConvert);
Intent intent = new Intent(mContext, AlarmReceiver.class);
intent.setAction("setYourActionHere");
PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext.getApplicationContext(), 234324243, intent, 0);
AlarmManager alarmManager = (AlarmManager) mContext.getSystemService(mContext.ALARM_SERVICE);
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, date.getTime(), AlarmManager.INTERVAL_DAY, pendingIntent);
} catch (Exception ex) {
ex.printStackTrace();
}
}
Make Receiver Class
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.
}
}
Register your Broadcast receiver in manifest file under Application tag
<receiver
android:name=".AlarmReceiver"
android:enabled="true"
android:exported="true"></receiver>