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

爱⌒轻易说出口 提交于 2019-12-22 04:49:09

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/37413519/xamarin-android-how-to-get-java-class-name-for-passing-into-componentname

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!