aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-03-31 22:28:44 +0200
committerChristian Schneppe <christian@pix-art.de>2018-03-31 22:28:44 +0200
commitebeb5f04ab10aeeda56597b29a757e657d71d218 (patch)
treee5d0ff2530c9795d9876c02b45d1790979a45ccd /src/main/java/de/pixart/messenger
parent164703b37a9bf876818112caf6a6edbf276bd8ec (diff)
skip background connect when changing theme
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationActivity.java6
-rw-r--r--src/main/java/de/pixart/messenger/ui/XmppActivity.java8
2 files changed, 12 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
index 52b993582..0934d967a 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
@@ -469,7 +469,8 @@ public class ConversationActivity extends XmppActivity implements OnConversation
@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
- savedInstanceState.putParcelable("intent", getIntent());
+ Intent pendingIntent = pendingViewIntent.pop();
+ savedInstanceState.putParcelable("intent", pendingIntent == null ? pendingIntent : getIntent());
super.onSaveInstanceState(savedInstanceState);
}
@@ -477,7 +478,10 @@ public class ConversationActivity extends XmppActivity implements OnConversation
protected void onStart() {
final int theme = findTheme();
if (this.mTheme != theme) {
+ this.mSkipBackgroundBinding = true;
recreate();
+ } else {
+ this.mSkipBackgroundBinding = false;
}
mRedirectInProcess.set(false);
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
index c6f9a70ca..d124b580b 100644
--- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
@@ -162,6 +162,8 @@ public abstract class XmppActivity extends AppCompatActivity {
}
};
+ public boolean mSkipBackgroundBinding = false;
+
public static boolean cancelPotentialWork(Message message, ImageView imageView) {
final BitmapWorkerTask bitmapWorkerTask = getBitmapWorkerTask(imageView);
@@ -221,7 +223,11 @@ public abstract class XmppActivity extends AppCompatActivity {
protected void onStart() {
super.onStart();
if (!xmppConnectionServiceBound) {
- connectToBackend();
+ if (this.mSkipBackgroundBinding) {
+ Log.d(Config.LOGTAG, "skipping background binding");
+ } else {
+ connectToBackend();
+ }
} else {
if (!registeredListeners) {
this.registerListeners();