lundi 20 mars 2017

if statment not working

I'm trying to do a test:

  1. if String==null or if String.equals(null).
  2. then upload image that i get from gallery.
  3. 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