Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
WebChromeClient在Android 5.0上提供“onShowFileChooser”,在Android 4.4下也提供“openFileChooser”方法,如何兼容?有没有人设法做到这一点?
也许您可以使用“Build.VERSION.SDK_INIT”来检查手机上使用您的应用程序的当前 sdk 版本。并决定使用哪个。
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { // do something with onShowFileChooser() } else { //do something with openFileChooser() }