Is it possible to use Android SDK methods with @hide annotation?

前端 未结 2 668
独厮守ぢ
独厮守ぢ 2020-12-11 15:35

Is it possible to use methods with @hide annotation without recompiling the sdk?

Note: I know I am not supposed to use this methods etc.

相关标签:
2条回答
  • 2020-12-11 15:49

    Yes it is possible to use those methods. In my case I had to override a hidden method, specifically openFileBrowser method of WebChromeClient. To do so I simply added the method to the class body which extends WebChromeClient and everything worked fine. However if I placed @Override annotation eclipse would complain and refuse to compile... just removed it and everything compiled and worked fine. Gilead gets accepted answer since his "Yes it is" was indeed correct and pushed me to experiment.

    0 讨论(0)
  • 2020-12-11 15:56

    Yes it is, reflection solves a whole lot of problems... And good to know you know you're not supposed to use them :)

    0 讨论(0)
提交回复
热议问题