Catch ActivityNotFoundException when launching a shortcut
This commit is contained in:
parent
20f6acc389
commit
7a038bd64e
@ -1,5 +1,6 @@
|
||||
package de.mm20.launcher2.search.data
|
||||
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.LauncherApps
|
||||
@ -47,6 +48,8 @@ class AppShortcut(
|
||||
launcherApps.startShortcut(launcherShortcut, null, options)
|
||||
} catch (e: IllegalStateException) {
|
||||
return false
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user