In the webview, one page from url is loaded. and in that page, a button for browse file is there in the name "choose file". When the user clicks the button, the app should show the gallery to select a file and retrieve it to that page as input. how c开发者_StackOverflow社区an i implement this?
To choose a file:
final int CHOOSE_FILE = 1;
//...
Intent chooseFile = new Intent(Intent.ACTION_GET_CONTENT);
chooseFile.setType("file/*");
Intent c = Intent.createChooser(chooseFile, "Choose file");
startActivityForResult(c, CHOOSE_FILE);
Then in your onActivityResult:
if(resultCode == RESULT_OK){
   Uri uri = data.getData();
   String filePath = uri.getPath();
   // here goes the code to upload the file
}
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论