From 1b9e2790646939de9fe791fc65b4d69eee39dfd2 Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Sun, 21 Apr 2019 14:28:51 +0200 Subject: [PATCH] fix issue with foreground service on Oreo+ (#1203) --- .../main/java/com/keylesspalace/tusky/ComposeActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java b/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java index 14ca21086..04aa41f79 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java @@ -956,7 +956,11 @@ public final class ComposeActivity getIntent().getStringExtra(SAVED_JSON_URLS_EXTRA), accountManager.getActiveAccount(), savedTootUid); - startService(sendIntent); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + startForegroundService(sendIntent); + } else { + startService(sendIntent); + } finishWithoutSlideOutAnimation();