android getSystemService(String s) - 反射?
我的问题涉及android开发。我想知道方法 context.getSystemService(String s)
是否使用反射。那里 在 Context
类中定义了许多 static
String
常量。我不确定这个方法背后的机制是如何工作的。这就是我问的原因。
My question concerns the android development. I would like to know if the method context.getSystemService(String s)
uses reflection. There
are many static
String
constants defined within the Context
class. I'm not sure how the mechanism behind this method works. Thats why I'm asking.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

查看代码 这里,看起来它只是使用
equals()
检查s
的值是什么,并返回一个适当的值.所以,那里没有反射。
Looking at the code here, it seems like it just checks what the value of
s
is, usingequals()
and returns an appropriate value.So, no Reflection there.