I'm trying to upload a image to php, for that I need to send a File to the server. So I am trying to create a file from the data parameter.
But I got this error Cannot resolve constructor File
Here's my code:
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {
// Get the url from data
Uri selectedImageUri = data.getData();
if (null != selectedImageUri) {
// File
File imageFilePath = new File(selectedImageUri);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…