I'm trying to do a test:
- if
String==nullor ifString.equals(null). - then upload image that i get from gallery.
- else then upload image from mipmap.
But it's not working,I tied also String!=uriBook and i checked uriBook it return null when i don't select image from gallery.
String uriBook=String.valueOf(bundle.getString("uRI"));
private void uploadFile() {
if(uriBook.equals(null) ) {
Uri imageUri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE +
"://" + getResources().getResourcePackageName(R.mipmap.ic_launcher)
+ '/' + getResources().getResourceTypeName(R.mipmap.ic_launcher) + '/' + getResources().getResourceEntryName(R.mipmap.ic_launcher));
getRiversRefDef.putFile(imageUri){
//source to upload image from mipmap
}else{
riversRef.putFile(Uri.parse(uriBook)){
//source to upload image from gallery
}
}
Aucun commentaire:
Enregistrer un commentaire