Home » Android » c# – Xamarin Android how to get Java class name for passing into ComponentName

c# – Xamarin Android how to get Java class name for passing into ComponentName

Posted by: admin June 15, 2020 Leave a comment

Questions:

I need the Java class’s name in the Constructor for Android.Content.ComponentName as Xamarin doesn’t have an overloaded constructor that takes typeof(ClrType) like it does for some other things.

How to&Answers:

I was able to solve it by doing this: Java.Lang.Class.FromType(typeof(MyClass)).Name