Stay organized with collections
Save and categorize content based on your preferences.
ReaderCallback
interface ReaderCallback
A callback to be invoked when the system finds a tag while the foreground activity is operating in reader mode.
Register your ReaderCallback
implementation with android.nfc.NfcAdapter#enableReaderMode
and disable it with android.nfc.NfcAdapter#disableReaderMode
.
Summary
Public methods |
abstract Unit |
|
Public methods
onTagDiscovered
abstract fun onTagDiscovered(tag: Tag!): Unit
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# NfcAdapter.ReaderCallback\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nReaderCallback\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/nfc/NfcAdapter.ReaderCallback \"View this page in Java\") \n\n```\ninterface ReaderCallback\n```\n\n|--------------------------------------------|\n| [android.nfc.NfcAdapter.ReaderCallback](#) |\n\nA callback to be invoked when the system finds a tag while the foreground activity is operating in reader mode.\n\nRegister your `ReaderCallback` implementation with [android.nfc.NfcAdapter#enableReaderMode](/reference/kotlin/android/nfc/NfcAdapter#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20kotlin.Int,%20android.os.Bundle)) and disable it with [android.nfc.NfcAdapter#disableReaderMode](/reference/kotlin/android/nfc/NfcAdapter#disableReaderMode(android.app.Activity)).\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onTagDiscovered](#onTagDiscovered(android.nfc.Tag))`(`tag:` `[Tag](/reference/kotlin/android/nfc/Tag)!`)` \u003cbr /\u003e |\n\nPublic methods\n--------------\n\n### onTagDiscovered\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onTagDiscovered(tag: Tag!): Unit\n```"]]