diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 864198699e..1bd5ac72fd 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -192,7 +192,6 @@ - @@ -1080,6 +1079,22 @@ + + + + + + + + + + + diff --git a/app/src/main/java/net/gsantner/markor/util/MarkorContextUtils.java b/app/src/main/java/net/gsantner/markor/util/MarkorContextUtils.java index f7386f52a1..c9fd835824 100644 --- a/app/src/main/java/net/gsantner/markor/util/MarkorContextUtils.java +++ b/app/src/main/java/net/gsantner/markor/util/MarkorContextUtils.java @@ -42,6 +42,7 @@ public T applySpecialLaunchersVisibility(final Contex setLauncherActivityEnabled(context, OpenEditorQuickNoteActivity.class, extraLaunchersEnabled); setLauncherActivityEnabled(context, OpenEditorTodoActivity.class, extraLaunchersEnabled); setLauncherActivityEnabled(context, OpenShareIntoActivity.class, extraLaunchersEnabled); + setLauncherActivityEnabledFromString(context, "net.gsantner.markor.AliasDocumentProcessText", extraLaunchersEnabled); return thisp(); } diff --git a/app/src/main/java/net/gsantner/opoc/util/GsContextUtils.java b/app/src/main/java/net/gsantner/opoc/util/GsContextUtils.java index 4445406240..c201ee59fb 100644 --- a/app/src/main/java/net/gsantner/opoc/util/GsContextUtils.java +++ b/app/src/main/java/net/gsantner/opoc/util/GsContextUtils.java @@ -1150,6 +1150,15 @@ public T setLauncherActivityEnabled(final Context con return thisp(); } + public T setLauncherActivityEnabledFromString(final Context context, String activityClass, boolean enable) { + try { + ComponentName component = new ComponentName(context, activityClass); + context.getPackageManager().setComponentEnabledSetting(component, enable ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED : PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); + } catch (Exception ignored) { + } + return thisp(); + } + /** * Try to create a new desktop shortcut on the launcher. Add permissions: *