diff options
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui/ConversationActivity.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationActivity.java | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index b4a8e56a..85b05e5b 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -83,18 +83,6 @@ public class ConversationActivity extends XmppActivity implements private Uri pendingImageUri = null; - private NfcAdapter.CreateNdefMessageCallback mNdefPushMessageCallback = new NfcAdapter.CreateNdefMessageCallback() { - @Override - public NdefMessage createNdefMessage(NfcEvent nfcEvent) { - Conversation conversation = getSelectedConversation(); - NdefMessage msg = new NdefMessage(new NdefRecord[]{ - NdefRecord.createUri("xmpp:"+conversation.getAccount().getJid()), - NdefRecord.createApplicationRecord("eu.siacs.conversations") - }); - return msg; - } - }; - public List<Conversation> getConversationList() { return this.conversationList; } @@ -122,6 +110,16 @@ public class ConversationActivity extends XmppActivity implements } } + @Override + protected String getShareableUri() { + Conversation conversation = getSelectedConversation(); + if (conversation!=null) { + return "xmpp:"+conversation.getAccount().getJid(); + } else { + return super.getShareableUri(); + } + } + public void hideConversationsOverview() { if (mContentView instanceof SlidingPaneLayout) { SlidingPaneLayout mSlidingPaneLayout = (SlidingPaneLayout) mContentView; @@ -163,9 +161,6 @@ public class ConversationActivity extends XmppActivity implements getActionBar().setDisplayHomeAsUpEnabled(false); getActionBar().setHomeButtonEnabled(false); - - registerNdefPushMessageCallback(this.mNdefPushMessageCallback); - this.listAdapter = new ConversationAdapter(this, conversationList); listView.setAdapter(this.listAdapter); @@ -665,6 +660,18 @@ public class ConversationActivity extends XmppActivity implements } @Override + public void onResume() { + super.onResume(); + this.registerNdefPushMessageCallback(); + } + + @Override + public void onPause() { + super.onPause(); + this.unregisterNdefPushMessageCallback(); + } + + @Override protected void onStop() { if (xmppConnectionServiceBound) { xmppConnectionService.removeOnConversationListChangedListener(); |