You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a class constructor is decorated with [Export] in order to provide super arguments string, TypeManager.Activate() call loses constructor parameters types info and wrong (parameterless) constructor is being called instead.
MyView.cs:
public class MyView : Android.Views.View {
public ItemFieldView(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
{
}
[Export(SuperArgumentsString = "p0, null, proj.droid.proj.droid.R.attr.itemFieldStyle")]
public MyView(Context context)
: base(context, null, Resource.Attribute.myViewStyle)
{
}
[Export(SuperArgumentsString = "p0, p1, proj.droid.proj.droid.R.attr.itemFieldStyle")]
public MyView(Context context, IAttributeSet attrs)
: base(context, attrs, Resource.Attribute.myViewStyle)
{
}
public MyView(Context context, IAttributeSet attrs, int defStyleAttr)
: base(context, attrs, defStyleAttr)
{
}
public MyView(Context context, IAttributeSet attrs, int defStyleAttr, int defStyleRes)
: base(context, attrs, defStyleAttr, defStyleRes)
{
}
}
Hi!
When a class constructor is decorated with
[Export]
in order to provide super arguments string,TypeManager.Activate()
call loses constructor parameters types info and wrong (parameterless) constructor is being called instead.MyView.cs:
The reason is that
managedParameters
are just not being passed to a newSignature
at https://github.com/xamarin/java.interop/blob/master/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/JavaCallableWrapperGenerator.cs#L251The text was updated successfully, but these errors were encountered: