Xamarin Forms 2.5 re consistenly recieve this error in Android when we force the Orientation of the page to Landscape then to Portrait in code.
Xamarin caused by: android.runtime.JavaProxyThrowable: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'.
Java.Interop.JniPeerMembers.AssertSelf(IJavaPeerable self)<e8c0e16a54534fa885244f0ad837c79e>:0
Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeNonvirtualVoidMethod(string encodedMember, IJavaPeerable self, JniArgumentValue* parameters)<e8c0e16a54534fa885244f0ad837c79e>:0
Android.Widget.TextView.set_TextFormatted(ICharSequence value)<848bbd7c681a4975918c72f17d2f5144>:0
Android.Widget.TextView.set_Text(string value)<848bbd7c681a4975918c72f17d2f5144>:0
Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer.UpdateText()<aae4e9ce5a5b4d3eaec4edf21079f3fa>:0
Set the MainActivity to ScreenOrientation = ScreenOrientation.Portrait
Add a Navigation Page
Add Two Pages
PageOne force it to Portrait in code with this:
```
var activity = (Activity)CrossCurrentActivity.Current.Activity;
if(activity.RequestedOrientation!= ScreenOrientation.Portrait )
activity.RequestedOrientation = ScreenOrientation.Portrait ;
Navigate to Page Two and Allow it to do Orientation Changes:
var activity = (Activity)CrossCurrentActivity.Current.Activity;
if(activity.RequestedOrientation!= ScreenOrientation.Unspecified)
activity.RequestedOrientation = ScreenOrientation.Unspecified;
```
Rotate the device while on PageTwo
Press Back to get back to PageOne
Error. Bang.
No error
I discovered it happens much "less" when I set the List Views on PageOne to CachingStrategy="RecycleElement"
Looks like this is caused by a cell be recycled incorrectly. This is why RecycleElements reduces the occurrence of the issue. A reproduction case would be incredibly useful. This is not the first report of the issue however the others also do not have a boiled down repro case :/
Sans repro we cant move forward. I suspect this is fixed by the recent android listview dummy cell fix anyway.
This bug still occurs for me (Xamarin Forms 2.5.0.280555)
Is there any solution for this or has this fixed with a later version?
This bug still occurs for me (Xamarin Forms 3.6.0.344457)
I have a repo in XF 4.x. I need an email address to send it to, it has licences.
I have a repo in XF 4.x. I need an email address to send it to, it has licences.
Please call @samhouts
@ianvink shneuvil at microsoft.com
@ianvink did you found a solution to your problem? We're still experiencing a similar issue on latest XF version.
Most helpful comment
I have a repo in XF 4.x. I need an email address to send it to, it has licences.