diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java index 5006e7f44..50adb41d8 100644 --- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java @@ -9,6 +9,7 @@ import android.content.ClipData; import android.content.ClipboardManager; import android.content.ComponentName; import android.content.Context; +import android.content.ContextWrapper; import android.content.DialogInterface; import android.content.Intent; import android.content.IntentSender.SendIntentException; @@ -1000,9 +1001,12 @@ public abstract class XmppActivity extends ActionBarActivity { } public static XmppActivity find(@NonNull final View view) { - final Context context = view.getContext(); - if (context instanceof XmppActivity) { - return (XmppActivity) context; + Context context = view.getContext(); + while (context instanceof ContextWrapper) { + if (context instanceof XmppActivity) { + return (XmppActivity) context; + } + context = ((ContextWrapper)context).getBaseContext(); } return null; }