On Saturday, September 15, 2012 11:27:01 AM UTC+12, solnichko wrote:
>
> Hi in the Boilerplate example the NfcReaderActivity has the following
> method:
>
> private void showList() {
> if(messages != null && messages.length > 0) {
>
> // display the first message
> byte[] messagePayload = messages[0].toByteArray();
>
byte[] textPayload = messages[0].getRecords()[0].getPayload();
id = new String(textPayload);
>
> // parse to records
> NdefMessageDecoder ndefMessageDecoder =
> NdefContext.getNdefMessageDecoder();
> List<Record> records =
> ndefMessageDecoder.decodeToRecords(messagePayload);
>
> // show in gui
> ArrayAdapter<? extends Object> adapter = new
> NdefRecordAdapter(this, records);
> ListView listView = (ListView)
> findViewById(R.id.recordListView);
> listView.setAdapter(adapter);
> } else {
> clearList();
> }
> }
>
>
> How could I extract the payload and use it to pass to different activity?
> E.g. if I had a simple integer in the payload.
>
> Thanks heaps for your help!!!
>
>
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en