title: Retrieve stored image from Firebase Storage
body: <p>I am trying to store and retrieve image by using Firebase. It is okay when storing an image, but I can't show it in an ImageView. It doesn't give an error so I can't understand where is the mistake.</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
  private Button btnSelectImage;
  private ImageView mImageView;
  
  private StorageReference mStorage;
  
  private static final int CAMERA_REQUEST_CODE = 1 ;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      btnSelectImage = (Button) findViewById(R.id.btn_image);
      mImageView = (ImageView) findViewById(R.id.imageView);
  
      //Get instance
      mStorage = FirebaseStorage.getInstance().getReference();
  
      btnSelectImage.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
              Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
              startActivityForResult(intent, CAMERA_REQUEST_CODE);
  
          }
      });
  
  }
  
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
  
      if(requestCode==CAMERA_REQUEST_CODE &amp;&amp; resultCode==RESULT_OK){
  
          Uri uri = data.getData();
  
          StorageReference filePath = mStorage.child("CameraPhotos").child(uri.getLastPathSegment());
          filePath.putFile(uri).addOnSuccessListener(new OnSuccessListener&lt;UploadTask.TaskSnapshot&gt;() {
              @Override
              public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
  
                  //Show image
                  Uri downloadUri = taskSnapshot.getDownloadUrl();
                  Picasso.with(MainActivity.this).load(downloadUri).into(mImageView);
  
                  Toast.makeText(MainActivity.this,"Upload Done",Toast.LENGTH_SHORT).show();
                  Log.v("Test","image load");
  
              }
          });
  
  
      }
  }
  }
  </code></pre>
  
  <p>Also give permissions</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.CAMERA"/&gt;
  &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/&gt;
  </code></pre>
  
  <p>Here is my Firebase Storage Rules</p>
  
  <pre><code>service firebase.storage {
    match /b/fir-app-ce89f.appspot.com/o {
      match /{allPaths=**} {
        allow read, write: if true;
      }
    }
  }
  </code></pre>
  
  <p>Here is my Activity Layout</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.example.yusuf.firebaseapp.MainActivity"&gt;
  
      &lt;Button
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="Select Image"
          android:id="@+id/btn_image"
          android:layout_alignParentTop="true"
          android:layout_centerHorizontal="true" /&gt;
  
      &lt;ImageView
          android:layout_width="400dp"
          android:layout_height="350dp"
          android:id="@+id/imageView"
          android:layout_centerVertical="true"
          android:layout_centerHorizontal="true" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>