Még egy kis UI rendezés
This commit is contained in:
@@ -3,6 +3,7 @@ using Android.Content;
|
||||
using Android.Content.PM;
|
||||
using Android.Nfc;
|
||||
using Android.OS;
|
||||
using Plugin.NFC;
|
||||
|
||||
|
||||
namespace WorkFlowCheck.MAUI
|
||||
@@ -32,6 +33,7 @@ namespace WorkFlowCheck.MAUI
|
||||
|
||||
protected override void OnCreate(Bundle savedInstanceState)
|
||||
{
|
||||
CrossNFC.Init(this);
|
||||
base.OnCreate(savedInstanceState);
|
||||
nfcAdapter = NfcAdapter.GetDefaultAdapter(this);
|
||||
pendingIntent = PendingIntent.GetActivity(this, 0,
|
||||
@@ -43,7 +45,9 @@ namespace WorkFlowCheck.MAUI
|
||||
protected override void OnNewIntent(Intent intent)
|
||||
{
|
||||
base.OnNewIntent(intent);
|
||||
|
||||
|
||||
CrossNFC.OnNewIntent(intent);
|
||||
|
||||
if (intent.Action == NfcAdapter.ActionTagDiscovered)
|
||||
{
|
||||
var tag = intent.GetParcelableExtra(NfcAdapter.ExtraTag) as Tag;
|
||||
@@ -55,7 +59,15 @@ namespace WorkFlowCheck.MAUI
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnResume()
|
||||
{
|
||||
base.OnResume();
|
||||
|
||||
// Plugin NFC: Restart NFC listening on resume (needed for Android 10+)
|
||||
CrossNFC.OnResume();
|
||||
}
|
||||
|
||||
public void StartNfc(Action<string> onTagRead)
|
||||
{
|
||||
_onTagRead = onTagRead;
|
||||
|
||||
Reference in New Issue
Block a user