Skip to content

Commit

Permalink
Fixed bug: cannot cancel scheduling
Browse files Browse the repository at this point in the history
  • Loading branch information
lhwdev committed Dec 26, 2020
1 parent 5f5e593 commit 1cd2456
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId "com.lhwdev.selfTestMacro"
minSdkVersion 19
targetSdkVersion 30
versionCode 1008
versionName "2.8"
versionCode 1009
versionName "2.9"

multiDexEnabled true

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/lhwdev/selfTestMacro/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ class MainActivity : AppCompatActivity() {
if(isSchedulingEnabled) {
@SuppressLint("SetTextI18n")
time.text = "매일 자가진단: ${pref.hour}${pref.min}"
updateTime(intent)
} else {
time.text = "시간 예약 안 됨"
}
updateTime(intent)
}

fun pickTime() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ suspend fun Context.submitSuspend(notification: Boolean = true) {
fun Context.updateTime(intent: PendingIntent) {
val alarmManager = getSystemService(Context.ALARM_SERVICE) as AlarmManager
alarmManager.cancel(intent)
if(preferenceState.hour != -1)
if(preferenceState.isSchedulingEnabled)
scheduleNextAlarm(intent, preferenceState.hour, preferenceState.min)
}

Expand Down

0 comments on commit 1cd2456

Please sign in to comment.