From 8cf935accc171232161f22faa08b63c471355187 Mon Sep 17 00:00:00 2001 From: onlymash Date: Wed, 28 Mar 2018 13:14:58 +0800 Subject: [PATCH] fix shortcuts --- .../ehviewer/shortcuts/ShortcutsActivity.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 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 796629592..c3b11c8f8 100644 --- a/app/src/main/java/com/hippo/ehviewer/shortcuts/ShortcutsActivity.java +++ b/app/src/main/java/com/hippo/ehviewer/shortcuts/ShortcutsActivity.java @@ -30,17 +30,14 @@ public class ShortcutsActivity extends Activity{ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - String action = null; - action = getIntent().getAction(); - if (!action.isEmpty()){ - 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 = 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); } finish(); }