mirror of
https://github.com/He4eT/yamf_launcher.git
synced 2026-05-04 17:37:25 +00:00
Merge pull request #9 from alrajdev/main
Fix crash when no Calendar app found on date click
This commit is contained in:
commit
b625a80e78
3 changed files with 15 additions and 6 deletions
|
|
@ -2,6 +2,7 @@ package eu.ottop.yamlauncher
|
|||
|
||||
import android.Manifest
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.ContentResolver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
|
|
@ -395,14 +396,19 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
|
|||
if (sharedPreferenceManager.isGestureEnabled("date") && dateApp.first != null && dateApp.second != null) {
|
||||
launcherApps.startMainActivity(dateApp.first!!.componentName, launcherApps.profiles[dateApp.second!!], null, null)
|
||||
} else {
|
||||
startActivity(
|
||||
Intent(
|
||||
Intent.makeMainSelectorActivity(
|
||||
Intent.ACTION_MAIN,
|
||||
Intent.CATEGORY_APP_CALENDAR
|
||||
try {
|
||||
startActivity(
|
||||
Intent(
|
||||
Intent.makeMainSelectorActivity(
|
||||
Intent.ACTION_MAIN,
|
||||
Intent.CATEGORY_APP_CALENDAR
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
catch(_: ActivityNotFoundException) {
|
||||
Toast.makeText(this, getString(R.string.no_calendar_app), Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
<string name="open_app_menu">Avaa sovellusvalikko</string>
|
||||
|
||||
<!--App Menu-->
|
||||
<string name="no_calendar_app">Kalenteri-sovellusta ei löytynyt</string>
|
||||
<string name="select_an_app">Valitse sovellus</string>
|
||||
|
||||
<string name="search">Haku…</string>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
<string name="open_app_menu">Open App Menu</string>
|
||||
|
||||
<string name="no_calendar_app">No Calendar app found</string>
|
||||
|
||||
<!--App Menu-->
|
||||
<string name="select_an_app">Select an app</string>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue