I'm currently working on expanding and collapsing logic within my listview with 2 Level group headers.
Due to a limitation of not being able to refresh the Groupheader I'm using
`private void ListView_GroupExpanded(object sender, GroupExpandCollapseChangedEventArgs e)
{
if (e.Groups.Count > 0)
{
var group = e.Groups[0];
sfWorkoutSessionList.RefreshListViewItem(-1, -1, true);
}
}`
to refresh the listview
but after doing this a few times or refreshing the data source, I'm faced with an exception
Java.Lang.NullPointerException: Attempt to read from field 'int android.view.ViewGroup$LayoutParams.width' on a null object reference
at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0008e] in <24e422c426e0468ca1fd74b59870ff08>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0001f] in <24e422c426e0468ca1fd74b59870ff08>:0
at Android.Widget.TextView.set_TextFormatted (Java.Lang.ICharSequence value) [0x0001f] in /Users/builder/azdo/_work/278/s/xamarin-android/src/Mono.Android/obj/Release/monoandroid10/android-29/mcw/Android.Widget.TextView.cs:3433
at Android.Widget.TextView.set_Text (System.String value) [0x0000d] in
Attachment:
expand_issue_d970a249.zip