fix shortcuts

This commit is contained in:
onlymash authored and seven332 committed 2018-03-29 19:30:58 +08:00
1 parent 2cf5589369
commit 8cf935accc
1 file changed
+8 -11
@@ -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();
}