Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in OnNewIntent when restarting the app. #33

Open
Gekidoku opened this issue Jan 11, 2019 · 0 comments
Open

Crash in OnNewIntent when restarting the app. #33

Gekidoku opened this issue Jan 11, 2019 · 0 comments

Comments

@Gekidoku
Copy link

Has to do with #23

Platform:
Xamarin Forms 3.4.0.1009999
Xamarin Android Targeting Android 8.1 API 27 Minimum API 21

What happens:
App crashes on restart.

Steps to reproduce.

Create A blank PCL project.
Add NFCForms
Build App
Open app on device.
Go back to device home screen by pressing the home key of your device.
Reopen the app from the app drawer.
Exception occurs.

So im writing this as an issue even though i know the solution.
It has to do with the check on line 92 in this file

For some reason it thinks droidTag has a value on a regular restart of the app.
However if you move the check to your MainActivity it sees it as null as expected.
MainActivity

protected override void OnNewIntent(Intent intent)
{
            base.OnNewIntent(intent);
            //Check that normally occurs in line 92
            var TestIntent = intent.GetParcelableExtra(NfcAdapter.ExtraTag) as Tag;
            if (TestIntent != null)
            {
                x.OnNewIntent(this, intent);
            }


}

For now this fixes it however its not the prettiest of solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant