Skip to content

Commit 59cfc0a

Browse files
antonisclaude
andcommitted
fix(feedback): preserve currentActivity in onActivityPaused when dialog is showing
onActivityPaused always fires before onActivityDestroyed. Without this fix, currentActivity was set to null in onPause, making the cleanup condition in onActivityDestroyed (activity == currentActivity) always false. This left isDialogShowing permanently stuck as true, disabling shake-to-feedback for the rest of the session. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 65122ca commit 59cfc0a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sentry-android-core/src/main/java/io/sentry/android/core/FeedbackShakeIntegration.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,13 @@ public void onActivityPaused(final @NotNull Activity activity) {
7676
// would kill shake detection for the new activity.
7777
if (activity == currentActivity) {
7878
stopShakeDetection();
79-
currentActivity = null;
79+
// Keep currentActivity set when a dialog is showing so onActivityDestroyed
80+
// can still match and clean up. Otherwise the cleanup condition
81+
// (activity == currentActivity) would always be false since onPause fires
82+
// before onDestroy.
83+
if (!isDialogShowing) {
84+
currentActivity = null;
85+
}
8086
}
8187
}
8288

0 commit comments

Comments
 (0)