We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfBackdropPage Error When Used With Shell

I'm trying to use SfBackdropPage with Xamarin Shell.  Please try the Android version of the attached project and select the 'About' tab to reproduce the error which is:

"System.NullReferenceException: 'Object reference not set to an instance of an object.'"

Thank you!

Attachment: App1_d060f43.zip

3 Replies

DV Divya Venkatesan Syncfusion Team January 30, 2020 11:50 AM UTC

Hi Dean, 
  
Greetings from Syncfusion. 
  
We are able to reproduce the reported issue and we will fix this issue internally. However, we suggest you to add the below code snippets in OnAppearing method to resolve this issue at application level. 
  
protected override void OnAppearing() 
{ 
    var navigationStack = Navigation.NavigationStack; 
    if (navigationStack.Count > 0 && navigationStack[navigationStack.Count - 1] != null) 
    { 
        base.OnAppearing(); 
    } 
} 
  
Please let us know if you need any further assistance. 
  
Regards, 
Divya Venkatesan 
 



DM Dean Martin January 30, 2020 09:14 PM UTC

That workaround seems to fix the issue.  I'm not sure if it causes other problems though.  I've tried to put a SfAccordion on the backlayer and that causes error:

Java.Lang.NullPointerException: 'Attempt to read from field 'int android.view.ViewGroup$LayoutParams.width' on a null object reference'

You can duplicate this by selecting the second tab when running the attached sample project on Android.

Thanks,
Dean

Attachment: App1_48c0b053.zip


LN Lakshmi Natarajan Syncfusion Team January 31, 2020 12:37 PM UTC

Hi Dean,  
  
We have checked the reported query from our side. We suspect you are reporting the crash in below bug report,  
  
  
If yes, we would like to inform that above is the framework issue in latest Xamarin Version while loading Label directly inside AccordionItem’s Header/Content and you can follow below bug for further updates from Xamarin team. Meanwhile, we suggest that you can overcome the reported issue in sample by loading Label inside Grid.   
   
Actual Code   
Expected Code   
<Syncfusion:SfAccordion> 
    <Syncfusion:SfAccordion.Items> 
        <Syncfusion:AccordionItem> 
           <Syncfusion:AccordionItem.Header> 
               <Label Text=”Category”/> 
           </Syncfusion:AccordionItem.Header> 
 
           <Syncfusion:AccordionItem.Content> 
               <Label Text=”Hamburger”/> 
           </Syncfusion:AccordionItem.Content> 
        </Syncfusion:AccordionItem> 
     </Syncfusion:SfAccordion.Items> 
<Syncfusion:SfAccordion> 
<Syncfusion:SfAccordion> 
    <Syncfusion:SfAccordion.Items> 
        <Syncfusion:AccordionItem> 
           <Syncfusion:AccordionItem.Header> 
               <Grid>  
                   <Label Text=”Category”/> 
               </Grid> 
           </Syncfusion:AccordionItem.Header> 
 
           <Syncfusion:AccordionItem.Content> 
               <Grid>  
                  <Label Text=”Hamburger”/> 
               </Grid> 
           </Syncfusion:AccordionItem.Content> 
        </Syncfusion:AccordionItem> 
     </Syncfusion:SfAccordion.Items> 
<Syncfusion:SfAccordion> 
   
If no and you are facing any other crash other than above, kindly share more details or revert us back with more detail of exception details in order to analyze and provide better solution at our end.  
  
Regards,  
 Lakshmi Natarajan

Loader.
Live Chat Icon For mobile
Up arrow icon