Fix: AlarmManager cancel - add action to Intent for proper alarm cancellation
- Add action to cancelAlarmInternal - Add action to cancelAllPendingIntentsForUniqueId - Fix deleted alarms still ringing (주, 석, 야, 기타) - Bump version to v1.2.2
This commit is contained in:
@@ -137,7 +137,9 @@ private fun cancelAllPendingIntentsForUniqueId(context: Context, uniqueId: Int)
|
||||
for (day in 1..31) {
|
||||
try {
|
||||
val alarmId = 200000000 + year * 1000000 + month * 10000 + day * 100 + baseId
|
||||
val intent = Intent(context, AlarmReceiver::class.java)
|
||||
val intent = Intent(context, AlarmReceiver::class.java).apply {
|
||||
action = "com.example.shiftalarm.ALARM_TRIGGER"
|
||||
}
|
||||
val pendingIntent = PendingIntent.getBroadcast(
|
||||
context, alarmId, intent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||
@@ -200,7 +202,9 @@ private fun cancelTestAlarm(context: Context) {
|
||||
|
||||
private fun cancelAlarmInternal(context: Context, alarmId: Int) {
|
||||
val alarmManager = context.getSystemService(Context.ALARM_SERVICE) as AlarmManager
|
||||
val intent = Intent(context, AlarmReceiver::class.java)
|
||||
val intent = Intent(context, AlarmReceiver::class.java).apply {
|
||||
action = "com.example.shiftalarm.ALARM_TRIGGER"
|
||||
}
|
||||
val pendingIntent = PendingIntent.getBroadcast(
|
||||
context, alarmId, intent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"versionCode": 1121,
|
||||
"versionName": "1.2.1",
|
||||
"apkUrl": "https://git.webpluss.net/sanjeok77/ShiftRing/releases/download/v1.2.1/app.apk",
|
||||
"changelog": "v1.2.1: 내부 버전 매칭 수정",
|
||||
"versionCode": 1122,
|
||||
"versionName": "1.2.2",
|
||||
"apkUrl": "https://git.webpluss.net/sanjeok77/ShiftRing/releases/download/v1.2.2/app.apk",
|
||||
"changelog": "v1.2.2: 삭제한 알람이 울리는 버그 수정 - AlarmManager 취소 시 action 누락 문제 해결",
|
||||
"forceUpdate": false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user