diff --git a/app/build.gradle b/app/build.gradle index 4c92622ed2..9e676b7603 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,8 +13,8 @@ android { applicationId "eu.faircode.email" minSdkVersion 21 targetSdkVersion 29 - versionCode 717 - versionName "1.717" + versionCode 718 + versionName "1.718" archivesBaseName = "FairEmail-v$versionName" // https://en.wikipedia.org/wiki/List_of_dinosaur_genera diff --git a/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java b/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java index 591fccd121..e026c9fdf4 100644 --- a/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java +++ b/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java @@ -36,6 +36,18 @@ public class PopupMenuLifecycle extends PopupMenu implements LifecycleObserver { super(context, anchor); this.owner = owner; Log.i("Instantiate " + this); + + anchor.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() { + @Override + public void onViewAttachedToWindow(View v) { + // Do nothing + } + + @Override + public void onViewDetachedFromWindow(View v) { + PopupMenuLifecycle.this.dismiss(); + } + }); } @Override