I'm trying to store info from Qr code on Firebase. I want to store the Url that I get from the Qr code to Firebase. I get "No content provider:" and "could not locate file for uploading:" error in logcat. How do I add Content Provider So I can upload the file.
This is my code so far. I use Zxing for the Qr code.
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
IntentIntegrator intentIntegrator = new IntentIntegrator(
main.this
);
intentIntegrator.setPrompt("Scan Qr Code, for light use volume up and down");
intentIntegrator.setBeepEnabled(false);
intentIntegrator.setOrientationLocked(true);
intentIntegrator.setCaptureActivity(Capture.class);
intentIntegrator.initiateScan();
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if(result != null) {
if(result.getContents() == null) {
Toast.makeText(this, "Cancelled", Toast.LENGTH_LONG).show();
} else {
String Contents = result.getContents();
imageUri10 = Uri.parse(Contents);
// Toast.makeText(this, Contents, Toast.LENGTH_LONG).show();
uploadImageToFirebase5();
}
} else {
super.onActivityResult(requestCode, resultCode, data);
}
}
private void uploadImageToFirebase5() {
StorageReference fileRef = storageReference.child("profile7.jpg");
fileRef.putFile(imageUri10);
}