diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e2a042c0f..57f5202f9 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -194,6 +194,11 @@ android:exported="false" android:theme="@style/Theme.Transparent" /> + + context.launchNewEventIntent() + NEW_EVENT -> launchNewEventActivity(context) LAUNCH_CAL -> launchCalenderInDefaultView(context) GO_TO_TODAY -> goToToday(context) else -> super.onReceive(context, intent) @@ -102,6 +103,17 @@ class MyWidgetListProvider : AppWidgetProvider() { } } + private fun launchNewEventActivity(context: Context) { + if (context.config.allowCreatingTasks) { + Intent(context, EventTypePickerActivity::class.java).apply { + addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + context.startActivity(this) + } + } else { + context.launchNewEventIntent() + } + } + private fun launchCalenderInDefaultView(context: Context) { (context.getLaunchIntent() ?: Intent(context, SplashActivity::class.java)).apply { putExtra(DAY_CODE, Formatter.getDayCodeFromDateTime(DateTime()))