I am trying to use the Java library inside a Xamarin project through binding . I need to pass class C to class type as a parameter for a Java method.
typeof() method in C sharp does not work because compilers compile
typeof()
Cannot implicitly convert type "System.Type" to "Java.Lang.Class"
Is there a way to convert it correctly?
Try using Java.Lang.Class.FromType(Type)in Xamarin.
Java.Lang.Class.FromType(Type)
For example, your C-class might be Car
Car
then name it Java.Lang.Class.FromType(typeof(Car))in xamarin
Java.Lang.Class.FromType(typeof(Car))