don't force NFC messages to ascii -- it breaks special chars and isn't

required, even with special chars.
This commit is contained in:
Eric House 2013-11-14 05:46:47 -08:00
parent e9bdf3c4f8
commit 4d6a37b048

View file

@ -29,7 +29,6 @@ import android.nfc.NfcAdapter;
import android.nfc.NfcEvent; import android.nfc.NfcEvent;
import android.nfc.NfcManager; import android.nfc.NfcManager;
import android.os.Parcelable; import android.os.Parcelable;
import java.nio.charset.Charset;
public class NFCUtils { public class NFCUtils {
private static boolean s_inSDK = private static boolean s_inSDK =
@ -95,10 +94,9 @@ public class NFCUtils {
{ {
String mimeType = activity.getString( R.string.xwords_nfc_mime ); String mimeType = activity.getString( R.string.xwords_nfc_mime );
NdefMessage msg = new NdefMessage( new NdefRecord[] { NdefMessage msg = new NdefMessage( new NdefRecord[] {
new NdefRecord(NdefRecord.TNF_MIME_MEDIA, mimeType new NdefRecord(NdefRecord.TNF_MIME_MEDIA,
.getBytes(Charset.forName("US-ASCII")), mimeType.getBytes(), new byte[0],
new byte[0], data.getBytes())
data.getBytes(Charset.forName("US-ASCII")))
,NdefRecord. ,NdefRecord.
createApplicationRecord( activity.getPackageName() ) createApplicationRecord( activity.getPackageName() )
}); });