WebChromeClient.FileChooserParams.parseResult(resultCode, data)

Asked 2 years ago, Updated 2 years ago, 32 views

WebChromeClient.FileChooserParams.parseResult(resultCode, data)

I don't know exactly what kind of role FileChooserParams is ㅠ<

And I think he's getting the parseResult result.

Member variable (resultCode, data) What values should be received and what should be included?

I don't know Please explain it easily (Crying)

android

2022-09-21 21:27

1 Answers

The WebChromeClient.FileChooserParams class is a function related to file upload. This class is available from Android 5.0, and delivers the options to use when displaying file pickers (e.g., whether to select only one file or multiple files, etc.) or post-processing after file selection occurs.

If you use createIntent() in the above class to float a file picker, you must pass the result value of onActivityResult() to parseResult(). The role of parseReult(), which is the content of the question, is to return the file Uri to the array by receiving the second and third parameters of onActivityResult(): int resultCode, Intent data.

In other words, it would be reasonable to understand that the file picker converts the selected file to Uri.

In Android 5.0, the developer had to do the processing of FileChooserParams himself. From 5.0 onwards, FileChooserParams can be used to simplify processing. Of course, you can handle it directly without using FileChooserParams.

See Official document for the overall flow of FileChooserParams.

How to use:


2022-09-21 21:27

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.