launch the selected app on click
This commit is contained in:
parent
8462d76aa7
commit
a195bff520
|
@ -99,7 +99,12 @@ class MainActivity : SimpleActivity() {
|
||||||
|
|
||||||
private fun setupAdapter(launchers: ArrayList<AppLauncher>) {
|
private fun setupAdapter(launchers: ArrayList<AppLauncher>) {
|
||||||
LaunchersAdapter(this, launchers, launchers_fastscroller) {
|
LaunchersAdapter(this, launchers, launchers_fastscroller) {
|
||||||
|
val launchIntent = packageManager.getLaunchIntentForPackage((it as AppLauncher).packageName)
|
||||||
|
try {
|
||||||
|
startActivity(launchIntent)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
showErrorToast(e)
|
||||||
|
}
|
||||||
}.apply {
|
}.apply {
|
||||||
launchers_grid.adapter = this
|
launchers_grid.adapter = this
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue