aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/de/pixart/messenger/ui/XmppActivity.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
index b254549af..afc319048 100644
--- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
@@ -10,6 +10,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;
@@ -1275,9 +1276,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;
}