android : how to send NFC data from dialogfragment?
<p>I have a question.
I want to send NFC data at DialogFragment &lt;- it is show AlertDialog</p>

<pre><code>public static class XDialogFragment extends DialogFragment {
    ...
    @Override
    public void onAttach(Activity activity) {
        // TODO Auto-generated method stub
    NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(activity);


    // Register callback to set NDEF message
    nfcAdapter.setNdefPushMessageCallback(new CreateNdefMessageCallback() {
        @Override
        public NdefMessage createNdefMessage(NfcEvent event) {
            ...
            return mes.getNdefMessage();
        }
    }, activity);

    // Register callback to listen for message-sent success
    nfcAdapter.setOnNdefPushCompleteCallback(new OnNdefPushCompleteCallback() {
        @Override
        public void onNdefPushComplete(NfcEvent event) {
           ...

        }
    }, activity);
        super.onAttach(activity);
    }
    ...
  }
</code></pre>

<p>it doesn't work callback function (CreateNdefMessageCallback,OnNdefPushCompleteCallback)</p>
