A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
mobile: fix crash on opening app from tile
Ammar Ahmed5774dd8c60a3
diff --git a/apps/mobile/native/android/app/src/main/java/com/streetwriters/notesnook/NotesnookTileService.java b/apps/mobile/native/android/app/src/main/java/com/streetwriters/notesnook/NotesnookTileService.javaindex ddb1b1b6c..08b2ab188 100644--- a/apps/mobile/native/android/app/src/main/java/com/streetwriters/notesnook/NotesnookTileService.java+++ b/apps/mobile/native/android/app/src/main/java/com/streetwriters/notesnook/NotesnookTileService.java@@ -1,5 +1,7 @@package com.streetwriters.notesnook;+import android.annotation.SuppressLint;+import android.app.PendingIntent;import android.content.Intent;import android.os.Build;import android.service.quicksettings.Tile;@@ -9,11 +11,24 @@ import androidx.annotation.RequiresApi;@RequiresApi(api = Build.VERSION_CODES.N)public class NotesnookTileService extends TileService {+ @SuppressLint("StartActivityAndCollapseDeprecated")@Overridepublic void onClick() {super.onClick();Intent intent = new Intent(this.getApplicationContext(), ShareActivity.class);- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);- startActivityAndCollapse(intent);+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);++ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {+ startActivityAndCollapse(+ PendingIntent.getActivity(+ this.getApplicationContext(),+ 0,+ intent,+ PendingIntent.FLAG_IMMUTABLE+ )+ );+ } else {+ startActivityAndCollapse(intent);+ }}}