Android: Extending a hidden class that is obtained through reflection

青春壹個敷衍的年華 提交于 2020-01-01 19:19:18

问题


How can I extend a class that is only accessible through reflection?

Basically, I am trying to extend the com.samsung.bluetoothle.BluetoothLEClientProfile class that is found in the Galaxy S3 to enable communication it with my bluetooth LE device. The class is hidden and I need to extend it.


回答1:


Add a dummy class in the right package (com.samsung.bluetoothle) in your project, then extend it. At runtime the system class will be loaded, and you should get the desired behaviour.



来源:https://stackoverflow.com/questions/14055419/android-extending-a-hidden-class-that-is-obtained-through-reflection

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