通过类名获取类。
Class serviceManager = Class.forName("android.os.ServiceManager");
获取方法
Method method = serviceManager.getMethod("getService", String.class);
调用方法
method.invoke(serviceManager.newInstance(), "phone");
参考博客:
http://blog.csdn.net/njchenyi/article/details/1620939
http://www.blogjava.net/zh-weir/archive/2011/03/26/347063.html
时间: 2024-10-07 08:02:32