KenCorbettJr commented on code in PR #1609: URL: https://github.com/apache/cordova-android/pull/1609#discussion_r1179383536
########## framework/src/org/apache/cordova/engine/SystemWebChromeClient.java: ########## @@ -211,54 +216,137 @@ public View getVideoLoadingProgressView() { return mVideoProgressView; } + // <input type=file> support: + // openFileChooser() is for pre KitKat and in KitKat mr1 (it's known broken in + // KitKat). + // For Lollipop, we use onShowFileChooser(). + public void openFileChooser(ValueCallback<Uri> uploadMsg) { + this.openFileChooser(uploadMsg, "*/*"); + } + + public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType) { + this.openFileChooser(uploadMsg, acceptType, null); + } + + public void openFileChooser(final ValueCallback<Uri> uploadMsg, String acceptType, String capture) { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.addCategory(Intent.CATEGORY_OPENABLE); + intent.setType("*/*"); + parentEngine.cordova.startActivityForResult(new CordovaPlugin() { Review Comment: I don't love it either. It was just a pattern that I saw and copied. I did some research and wasn't able to identify a better way to both trigger a new activity and get the result from that activity as we do here. But I am not that great of an Android developer, a more skilled developer may be aware of a better way to handle this. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org