Skip to content

Commit 1c84bb9

Browse files
committed
fix: change icon on activity close to prevent closing the main activity after first install
1 parent 269eb5a commit 1c84bb9

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

app/src/main/kotlin/me/amrbashir/hijriwidget/settings/MainActivity.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,17 @@ class MainActivity : ComponentActivity() {
6868
runBlocking { HijriDate.syncDatabaseIfNot(this@MainActivity.baseContext) }
6969
HijriDate.load(this.baseContext, Settings.language.value)
7070

71-
// TODO: find a better way to change icon when app is first installed
72-
HijriWidgetLauncherIconWorker.changeLauncherIcon(this.baseContext)
73-
7471
setContent {
7572
Content()
7673
}
7774
}
7875

76+
override fun onDestroy() {
77+
// TODO: find a better way to change icon when app is first installed
78+
HijriWidgetLauncherIconWorker.changeLauncherIcon(this.baseContext)
79+
super.onDestroy()
80+
}
81+
7982
@Composable
8083
private fun Content() {
8184
val navController = rememberNavController()

0 commit comments

Comments
 (0)