0

WebChromeClient supply "onShowFileChooser" on Android 5.0, also supply "openFileChooser" method below Android 4.4 method,How to compatible with them? Has anyone managed to do this?

Elvira
  • 1
  • 2

1 Answers1

0

Maybe you can use "Build.VERSION.SDK_INIT" to check the current sdk version on the phone used your app. And decide which to use.

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    // do something with onShowFileChooser()
} else {
    //do something with openFileChooser()
}
Luis404
  • 196
  • 4
  • hi @Luis404,My issue is the method "onShowFileChooser" belong with Android API level 21,but my project is using api level 19,if i use api level 21 or 22,the api won't supply "openFileChooser" method. So, how to do this? – Elvira Jul 17 '15 at 09:29