Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
kksd
Posts: 2
Registered: ‎04-03-2012
My Carrier: Rogers

NFCFieldListener

Hi Guys,

 

Anybody have used NFCFieldlistener? I am building an application require actions when leaving the NFC field, I implemented this:

    public class NfcListener implements NFCFieldListener{
        public void onFieldChanged(final int fieldEvent)
        {

            UiApplication.getUiApplication().invokeLater(new Runnable() {
                
                public void run() {
                    if( fieldEvent == NFCFieldListener.Field_NOT_PRESENT )

                                  //DO WHATEVER
                }
            });
        }
    }

 

But,

myNFCManager = NFCManager.getInstance();
myNFCManager.addNFCFieldListener( new NfcListener());

 

Never triger the listener no matter what I do with the NFC tag.

 

Any suggestions?

 

Thanks,

Please use plain text.
New Contributor
kksd
Posts: 2
Registered: ‎04-03-2012
My Carrier: Rogers

Re: NFCFieldListener

somebody please help :smileytongue:

Please use plain text.
New Contributor
joaquinmiguelfernandez
Posts: 3
Registered: ‎11-23-2012
My Carrier: RIM

Re: NFCFieldListener

Hi, I've the same problem and I'll apreciate any answer too.

 

Regards

Please use plain text.