How to cast C# interface to Java.Lang.Object?

SanifSSSanifSS USMember
edited November 2017 in Xamarin.Android

Hi All,

Currently, I am working on IEGL10 in Xamarin. I have implemented ISurfaceHolderCallback and on SurfaceCreated(ISurfaceHolder holder) I have to call a method like this.

public void SurfaceCreated(ISurfaceHolder holder)
mEglSurface = mEgl.EglCreateWindowSurface(mEglDisplay, mEglConfig,
holder, null);
The problem is, the holder is a C# interface and EglCreateWindowSurface requires Java.Lang.Object. So how can I do the casting? If I directly cast holder like (Java.Lang.Object)holder. It is throwing invalid cast exception. Please help guys I am really stuck here.

Sign In or Register to comment.