aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 45a3376a..5bb8113a 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 6e5105f5..55a0d1a5 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 968e1647..4d15addb 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;