Upload image to Firebase Database

0

I'm having trouble uploading an image to Firebase Database with Android Studio, could it be uploaded by converting it first to String in this way?

private void cargarimagen(){
    Intent intent=new Intent(Intent.ACTION_PICK);
    intent.setType("image/");
    startActivityForResult(intent,GALLERY_INTENT);
}

public void imagencarga(View view) {
    cargarimagen();
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

     if(resultCode==RESULT_OK) {
        Uri path = data.getData();
        imagen.setImageURI( path );
        String pathIntent = path.toString();
       }
  }

If I can not imagine I would have to look with FirebaseStorage

    
asked by lujan 28.02.2018 в 17:54
source

0 answers