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

All cells crashes with null reference exception when used as Embedded Forms Fragments #69

Closed
follesoe opened this issue Sep 17, 2019 · 1 comment

Comments

@follesoe
Copy link

When embedding Xamarin.Form pages into a Xamarin.Android native app the app crashes with a Null Reference Exception. The reason for this exception is this code line:

https://github.com/muak/AiForms.SettingsView/blob/master/SettingsView.Droid/Cells/CellBaseView.cs#L102

var contentView = (_Context as FormsAppCompatActivity).LayoutInflater.Inflate(Resource.Layout.CellBaseView, this, true);

When used in an embedded context, you cannot assume _Context is of type FormsAppCompatActivity.

Information about embedding: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/platform/native-forms

@muak
Copy link
Owner

muak commented Jan 18, 2020

@follesoe
Thank you for your report.

This issue is fixed in :
#79

@muak muak closed this as completed Jan 18, 2020
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

2 participants