title: BitmapFactory: Unable to decode stream: java.io.FileNotFoundException:
body: <p>I have an arraylist which stores all the Uri's downloaded from Firebase storage.</p>
  
  <p>I am passing this list to my CustomAdapter so as to display all the images in a ViewPager but, unable to do so because of the following error:</p>
  
  <p>BitmapFactory: Unable to decode stream: java.io.FileNotFoundException:</p>
  
  <p>MainActivity:</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      btn = (Button) findViewById(R.id.btn);
      show = (Button) findViewById(R.id.btn2);
      mStorageRef = FirebaseStorage.getInstance().getReference();
      pd = new ProgressDialog(this);
      btn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              Intent i = new Intent(Intent.ACTION_PICK);
              i.setType("image/*");
              startActivityForResult(i, GALLERY_INTENT);
          }
      });
      show.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              pager =(ViewPager) findViewById(R.id.view_pager);
              adapter = new CustomAdapter(MainActivity.this, list);
              pager.setAdapter(adapter);
              adapter.notifyDataSetChanged();
          }
      });
  }
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
      if(requestCode == GALLERY_INTENT &amp;&amp; resultCode == RESULT_OK){
          pd.setMessage("Uploading...!");
          pd.show();
          Uri file = data.getData();
          StorageReference filepath = mStorageRef.child("Photos").child(file.getLastPathSegment());
  
          filepath.putFile(file)
                  .addOnSuccessListener(new OnSuccessListener&lt;UploadTask.TaskSnapshot&gt;() {
                      @Override
                      public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
                          // Get a URL to the uploaded content
                          Uri downloadUrl = taskSnapshot.getDownloadUrl();
                          list.add(downloadUrl);
                          pd.dismiss();
                          Toast.makeText(MainActivity.this, "Upload done!", Toast.LENGTH_LONG).show();
                      }
                  })
                  .addOnFailureListener(new OnFailureListener() {
                      @Override
                      public void onFailure(@NonNull Exception exception) {
                          // Handle unsuccessful uploads
                          // ...
                      }
                  });
      }
  }
  </code></pre>
  
  <p>CustomAdapter:</p>
  
  <pre><code>@Override
  public Object instantiateItem(ViewGroup container, int position) {
      inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      View v =  inflater.inflate(R.layout.swipe,container,false);
      ImageView img = (ImageView) v.findViewById(R.id.imageView);
      Bitmap bitmap = BitmapFactory.decodeFile(list.get(position).getPath());
      img.setImageBitmap(bitmap);
      container.addView(v);
      return v;
  }
  </code></pre>