launch the selected app on click

This commit is contained in:
tibbi 2022-08-12 16:34:33 +02:00
parent 8462d76aa7
commit a195bff520
1 changed files with 6 additions and 1 deletions

View File

@ -99,7 +99,12 @@ class MainActivity : SimpleActivity() {
private fun setupAdapter(launchers: ArrayList<AppLauncher>) {
LaunchersAdapter(this, launchers, launchers_fastscroller) {
val launchIntent = packageManager.getLaunchIntentForPackage((it as AppLauncher).packageName)
try {
startActivity(launchIntent)
} catch (e: Exception) {
showErrorToast(e)
}
}.apply {
launchers_grid.adapter = this
}