Skip to content

Commit

Permalink
Some NFC fixes for Android 12 (#1830)
Browse files Browse the repository at this point in the history
  • Loading branch information
dshokouhi committed Oct 24, 2021
1 parent e1cc6c8 commit ff20e45
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Expand Up @@ -284,7 +284,7 @@
<activity
android:name=".nfc.TagReaderActivity"
android:label="@string/tag_reader_title"
android:exported="false">
android:exported="true">
<tools:validation testUrl="https://www.home-assistant.io/tag/123e4567-e89b-12d3-a456-426614174000" />

<intent-filter>
Expand Down
Expand Up @@ -37,7 +37,7 @@ object NFCUtil {
fun <T> enableNFCInForeground(nfcAdapter: NfcAdapter, activity: Activity, classType: Class<T>) {
val pendingIntent = PendingIntent.getActivity(
activity, 0,
Intent(activity, classType).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), PendingIntent.FLAG_IMMUTABLE
Intent(activity, classType).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), PendingIntent.FLAG_MUTABLE
)
val nfcIntentFilter = IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED)
val filters = arrayOf(nfcIntentFilter)
Expand Down

0 comments on commit ff20e45

Please sign in to comment.