From b0bf78dffcfbd760cb76364c90d3459a1b407afe Mon Sep 17 00:00:00 2001 From: chizoba Date: Thu, 5 Oct 2017 17:25:33 +0100 Subject: [PATCH] fix: shortcut to launch urls --- .../github/dfa/diaspora_android/activity/MainActivity.java | 5 +++-- app/src/main/res/menu/main__navdrawer.xml | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java b/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java index 19b2ad29..5d5a75b6 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java @@ -1161,11 +1161,12 @@ public class MainActivity extends ThemedActivity case R.id.nav_shortcut: { Intent shortcutIntent = new Intent(MainActivity.this, MainActivity.class); - shortcutIntent.setAction(Intent.ACTION_MAIN); + shortcutIntent.setAction(Intent.ACTION_VIEW); + shortcutIntent.setData(Uri.parse(urls.getStreamUrl())); // The intent responsible for creating the shortcut Intent intent = new Intent(); intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent); - intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.app_name)); + intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, _appSettings.getPod().getName()); intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource.fromContext(MainActivity.this, R.drawable.ic_launcher)); // To install shortcut intent.setAction("com.android.launcher.action.INSTALL_SHORTCUT"); diff --git a/app/src/main/res/menu/main__navdrawer.xml b/app/src/main/res/menu/main__navdrawer.xml index f9e0c9b8..0678fc00 100644 --- a/app/src/main/res/menu/main__navdrawer.xml +++ b/app/src/main/res/menu/main__navdrawer.xml @@ -73,6 +73,10 @@ android:icon="@drawable/ic_cancel_black_48px" android:title="@string/action_exit_app" android:visible="false" /> + + @@ -91,9 +95,6 @@ android:icon="@drawable/ic_info_black_48px" android:title="@string/nav_help_license" /> -