aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2015-01-06 18:40:51 +0100
committerSamuel Tardieu <sam@rfc1149.net>2015-01-06 19:22:09 +0100
commit525d94c31353d81760b73cf79682dd1988fa407e (patch)
tree46e4ff98b5200c7379d35e32ead8395ae0f625ac
parent57c41e935ea98738fec5bcdd79ccf854d98cb8af (diff)
downloadcgeo-525d94c31353d81760b73cf79682dd1988fa407e.zip
cgeo-525d94c31353d81760b73cf79682dd1988fa407e.tar.gz
cgeo-525d94c31353d81760b73cf79682dd1988fa407e.tar.bz2
Favor cgeo over other applications when transmitting a cache using NFC
-rw-r--r--main/src/cgeo/geocaching/activity/AbstractActivity.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/activity/AbstractActivity.java b/main/src/cgeo/geocaching/activity/AbstractActivity.java
index ba11958..4cddfe6 100644
--- a/main/src/cgeo/geocaching/activity/AbstractActivity.java
+++ b/main/src/cgeo/geocaching/activity/AbstractActivity.java
@@ -231,7 +231,14 @@ public abstract class AbstractActivity extends ActionBarActivity implements IAbs
@Override
public NdefMessage createNdefMessage(final NfcEvent event) {
final String uri = sharingInterface.getAndroidBeamUri();
- return uri != null ? new NdefMessage(new NdefRecord[]{NdefRecord.createUri(uri)}) : null;
+ if (uri == null) {
+ return null;
+ }
+ final NdefRecord[] records = {
+ NdefRecord.createUri(uri),
+ NdefRecord.createApplicationRecord(CgeoApplication.getInstance().getPackageName())
+ };
+ return new NdefMessage(records);
}
}, this);