kill application on back press (#739)

* kill application on back press

* fix: spotless
This commit is contained in:
Yogesh Choudhary Paliyal
2023-10-28 11:16:39 +05:30
committed by GitHub
parent 5ea20b73e3
commit b060599efc
2 changed files with 5 additions and 13 deletions

View File

@@ -89,6 +89,10 @@ class DashboardComposeActivity : AppCompatActivity() {
})
}
}
override fun onDestroy() {
super.onDestroy()
}
}
@Composable
@@ -104,7 +108,7 @@ fun Dashboard() {
LaunchedEffect(key1 = systemBackPress, block = {
if (systemBackPress) {
(context as? ComponentActivity)?.onBackPressed()
(context as? ComponentActivity)?.finishAffinity()
}
})

View File

@@ -1,12 +0,0 @@
package com.yogeshpaliyal.keypass.utils
import androidx.recyclerview.widget.DiffUtil
/**
* Alias to represent a folder (a String title) into which emails can be placed.
*/
object StringDiffUtil : DiffUtil.ItemCallback<String>() {
override fun areItemsTheSame(oldItem: String, newItem: String) = oldItem == newItem
override fun areContentsTheSame(oldItem: String, newItem: String) = oldItem == newItem
}