aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-03-28 12:22:09 +0100
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-03-28 12:22:09 +0100
commit0b235171a82d41a00dda5e5f64ff73ffb24f4d10 (patch)
treee9daf0a43ae33e9a43219c5b72b7f181c0aeb4a7
parent9fa95f50ae2dca51308245038a1d50b3ab8a09bd (diff)
tryping to fix #24 - notificationgate - since i still cant reproduce this patches are all blind
-rw-r--r--src/eu/siacs/conversations/ui/ConversationActivity.java6
-rw-r--r--src/eu/siacs/conversations/ui/ConversationFragment.java10
-rw-r--r--src/eu/siacs/conversations/ui/XmppActivity.java3
3 files changed, 15 insertions, 4 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java
index 45a3376a5..5bb8113a1 100644
--- a/src/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/eu/siacs/conversations/ui/ConversationActivity.java
@@ -394,11 +394,14 @@ public class ConversationActivity extends XmppActivity {
return super.onKeyDown(keyCode, event);
}
+ @Override
public void onStart() {
super.onStart();
- this.registerListener();
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
this.useSubject = preferences.getBoolean("use_subject_in_muc", true);
+ if (this.xmppConnectionServiceBound) {
+ this.onBackendConnected();
+ }
if (conversationList.size()>=1) {
onConvChanged.onConversationListChanged();
}
@@ -406,7 +409,6 @@ public class ConversationActivity extends XmppActivity {
@Override
protected void onStop() {
- Log.d("gultsch","called on stop in conversation activity");
if (xmppConnectionServiceBound) {
xmppConnectionService.removeOnConversationListChangedListener();
}
diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java
index 6e5105f5d..55a0d1a51 100644
--- a/src/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/eu/siacs/conversations/ui/ConversationFragment.java
@@ -115,6 +115,7 @@ public class ConversationFragment extends Fragment {
startActivity(intent);
}
};
+ private ConversationActivity activity;
public void hidePgpPassphraseBox() {
pgpInfo.setVisibility(View.GONE);
@@ -325,16 +326,21 @@ public class ConversationFragment extends Fragment {
@Override
public void onStart() {
super.onStart();
- ConversationActivity activity = (ConversationActivity) getActivity();
+ this.activity = (ConversationActivity) getActivity();
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
this.useSubject = preferences.getBoolean("use_subject_in_muc", true);
if (activity.xmppConnectionServiceBound) {
this.onBackendConnected();
}
}
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ activity.registerListener();
+ }
public void onBackendConnected() {
- final ConversationActivity activity = (ConversationActivity) getActivity();
activity.registerListener();
this.conversation = activity.getSelectedConversation();
if (this.conversation == null) {
diff --git a/src/eu/siacs/conversations/ui/XmppActivity.java b/src/eu/siacs/conversations/ui/XmppActivity.java
index 968e16473..4d15addbb 100644
--- a/src/eu/siacs/conversations/ui/XmppActivity.java
+++ b/src/eu/siacs/conversations/ui/XmppActivity.java
@@ -19,6 +19,9 @@ import android.view.View;
import android.view.inputmethod.InputMethodManager;
public abstract class XmppActivity extends Activity {
+
+ protected final static String LOGTAG = "xmppService";
+
public XmppConnectionService xmppConnectionService;
public boolean xmppConnectionServiceBound = false;
protected boolean handledViewIntent = false;