XamarinFormsPinView
XamarinFormsPinView copied to clipboard
System.ObjectDisposedException: Cannot access a disposed object
Getting this exception in some of the Android devices. FormsPinView(2.1.0-pre1)
Object name: 'Android.Graphics.Paint'. at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <07754f4cea12486d9464281b313bc550>:0 at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <07754f4cea12486d9464281b313bc550>:0 at Android.Graphics.Paint.set_Alpha (System.Int32 value) [0x00022] in <61fdc70e3ec6449cbca4b2444bcf1f69>:0 at FormsPinView.Droid.RippleButton+<>c__DisplayClass17_0.<OnTouchEvent>b__0 () [0x0003a] in <49f4c9956baa4d22a04ad433dcdfbd74>:0 at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <61fdc70e3ec6449cbca4b2444bcf1f69>:0 at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <61fdc70e3ec6449cbca4b2444bcf1f69>:0 at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.48(intptr,intptr)
@shivraj251 did you get around this?
@Joebu most likely you need to adjust RippleButton class:
public void Dispose(bool isDisposing)
{
if (isDisposing)
{
_handler?.RemoveCallbacksAndMessages(null);
}
base.Dispose(isDisposing);
}
@Joebu, no i could not get any solution finally I removed the FormsPinView and implement custom layout that is working well.
@lassana I tried but getting same error.