From 00485efd0efa65313fe235807e8c5e5d03f8c384 Mon Sep 17 00:00:00 2001 From: onlymash Date: Wed, 28 Mar 2018 14:30:10 +0800 Subject: [PATCH] update shortcut --- .../ehviewer/shortcuts/ShortcutsActivity.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/hippo/ehviewer/shortcuts/ShortcutsActivity.java b/app/src/main/java/com/hippo/ehviewer/shortcuts/ShortcutsActivity.java index c3b11c8f8..9c45b1b63 100644 --- a/app/src/main/java/com/hippo/ehviewer/shortcuts/ShortcutsActivity.java +++ b/app/src/main/java/com/hippo/ehviewer/shortcuts/ShortcutsActivity.java @@ -30,14 +30,13 @@ public class ShortcutsActivity extends Activity{ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - String action = getIntent().getAction(); - Intent intent = new Intent(this, DownloadService.class); - if (action.equals(DownloadService.ACTION_START_ALL)){ - intent.setAction(DownloadService.ACTION_START_ALL); - startService(intent); - } else if (action.equals(DownloadService.ACTION_STOP_ALL)){ - intent.setAction(DownloadService.ACTION_STOP_ALL); - startService(intent); + String action = null; + Intent intent = getIntent(); + if (intent != null){ + action = intent.getAction(); + if (action != null){ + startService(new Intent(this, DownloadService.class).setAction(action)); + } } finish(); }