I need to use methods from java.lang.reflect
in a MonoDroid solution, but I can't find this namespace anywhere. Is there a way to access these?
Asked
Active
Viewed 230 times
1

Kevin Bedell
- 13,254
- 10
- 78
- 114

Brans
- 649
- 1
- 7
- 20
-
What do you need it for? Can't you use C# Reflection? – Cheesebaron Jul 07 '12 at 11:59
-
I need to call Android private method.. to set "Data enable" in setings. Can i do this by C# Reflection? – Brans Jul 07 '12 at 13:37
-
I think best way to do this is actually write it in Java and bind it to your managed code through JNI. – Cheesebaron Jul 07 '12 at 13:38
1 Answers
1
The java.lang.reflect package is not bound in Mono for Android. This bug has some more details about that. If you really need to work around that limitation, you could write that part of your application in Java and then call it through JNI. Xamarin has a good guide on using JNI up here.

Greg Shackles
- 10,009
- 2
- 29
- 35