register nfc callback in every activity that provides a proper sharable uri

This commit is contained in:
iNPUTmice 2014-11-04 17:10:35 +01:00
parent 11ecf43da7
commit b824e55277
5 changed files with 18 additions and 16 deletions

View file

@ -144,7 +144,7 @@ public class ConferenceDetailsActivity extends XmppActivity {
if (conversation!=null) {
return "xmpp:"+conversation.getContactJid().split("/")[0]+"?join";
} else {
return super.getShareableUri();
return "";
}
}

View file

@ -166,7 +166,7 @@ public class ContactDetailsActivity extends XmppActivity {
if (contact!=null) {
return "xmpp:"+contact.getJid();
} else {
return super.getShareableUri();
return "";
}
}

View file

@ -116,7 +116,7 @@ public class ConversationActivity extends XmppActivity implements
if (conversation!=null) {
return "xmpp:"+conversation.getAccount().getJid();
} else {
return super.getShareableUri();
return "";
}
}
@ -659,18 +659,6 @@ 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) {

View file

@ -287,7 +287,7 @@ public class EditAccountActivity extends XmppActivity {
if (mAccount!=null) {
return "xmpp:"+mAccount.getJid();
} else {
return super.getShareableUri();
return "";
}
}

View file

@ -588,6 +588,20 @@ public abstract class XmppActivity extends Activity {
return null;
}
@Override
public void onResume() {
super.onResume();
if (this.getShareableUri()!=null) {
this.registerNdefPushMessageCallback();
}
}
@Override
public void onPause() {
super.onPause();
this.unregisterNdefPushMessageCallback();
}
protected void showQrCode() {
String uri = getShareableUri();
if (uri!=null) {