john barrowman
Lurker
Currently I have a button which opens a file browser for the user to select a file (currently images) but once they've selected it I'm not sure how I can get the file path and use that to upload it to Firebase storage.
what would I put inside the if statement to be able to get the filepath and use UploadTask to upload it?
Code:
private void fileChooser(){
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Select a file to upload"),
REQUEST_CODE);
}
[USER=1021285]@override[/USER]
protected void onActivityResult(int returnedCode, int returnedResult, Intent file){
super.onActivityResult(returnedCode, returnedResult, file);
if(returnedCode == REQUEST_CODE && returnedResult == RESULT_OK && file != null && file.getData() != null){
}
}
what would I put inside the if statement to be able to get the filepath and use UploadTask to upload it?
Last edited by a moderator: