Open joshsutterfield opened 4 years ago
Unable to duplicate but have seen InvalidCastException logged in crashes coming from here. Most likely one of the two casts is casting null. Cannot fix or bypass with override since Android requires base.OnRestoreInstanceState to be called.
protected override void OnRestoreInstanceState(IParcelable parcel) { Bundle bundle = (Bundle)parcel; base.OnRestoreInstanceState((IParcelable)bundle.GetParcelable("SUPER")); NormalizedMinValue = bundle.GetFloat("MIN"); NormalizedMaxValue = bundle.GetFloat("MAX"); }
Suggest alternate code:
if (parcel is Bundle bundle) { base.OnRestoreInstanceState(bundle.GetParcelable("SUPER") as IParcelable); NormalizedMinValue = bundle.GetFloat("MIN"); NormalizedMaxValue = bundle.GetFloat("MAX"); } else { base.OnRestoreInstanceState(parcel); }
Can you provide a sample project to reproduce the problem?
Unable to duplicate but have seen InvalidCastException logged in crashes coming from here. Most likely one of the two casts is casting null. Cannot fix or bypass with override since Android requires base.OnRestoreInstanceState to be called.
Suggest alternate code: