Last active
July 14, 2021 19:37
Revisions
-
wcoder revised this gist
Jul 14, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Java | C# (Xamarin.Android) can be implemented via extension: ```cs public static class JavaLangExtensions { public static Java.Lang.Class GetClass(this Java.Lang.Object obj) { -
wcoder revised this gist
Jul 14, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,6 +21,6 @@ public static class JavaLangExtesnsions return Java.Lang.Class.FromType(obj.GetType()); } } ``` -
wcoder revised this gist
Jul 14, 2021 . 1 changed file with 18 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,21 @@ ### How to get Java class from C# type? Java.Lang.Class has a special method for managed types: Java | C# (Xamarin.Android) ----------------------|---------------------- `ClickableSpan.class` | `Java.Lang.Class.FromType(typeof(ClickableSpan))` can be implemented via extension: ```cs public static class JavaLangExtesnsions { public static Java.Lang.Class GetClass(this Java.Lang.Object obj) { return Java.Lang.Class.FromType(obj.GetType()); } } `` -
wcoder revised this gist
Jul 14, 2021 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,6 +8,4 @@ Java.Lang.Class has a special method for managed types: Java | C# -----|----- `ClickableSpan.class` | `Java.Lang.Class.FromType(typeof(ClickableSpan))` -
wcoder revised this gist
Jul 14, 2021 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,8 @@ ### How to get Java class from C# type? Java.Lang.Class has a special method for managed types: Java | C# -----|----- `ClickableSpan.class` | ```cs Java.Lang.Class.FromType(typeof(ClickableSpan)) ``` -
wcoder created this gist
Jul 14, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ ## Xamarin.Android ### How to get Java class from C# type? Java.Lang.Class has a special method for managed types: ```cs Java.Lang.Class.FromType(typeof(ClickableSpan)) ```