title: Showing all images from a directory of android storage in android recyclerView
body: <p><strong>I am saving photo in a directory and I want to show them all in recyclerView with showing all info of image in TextView</strong></p>
  
  <p>There is my codes 
  MainActivity :</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
  
      RecyclerView rec;
      RecyclerViewAdapter recyclerViewAdapter;
      List&lt;Items&gt; list = new ArrayList&lt;&gt;();
  
      Bitmap bitmap;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
          rec= (RecyclerView) findViewById(R.id.recView);
  
          File fi = new File(Environment.getExternalStorageDirectory() + "/PhotosOfSalman");
          if (fi.isDirectory()) {  
              rec.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
  
              recyclerViewAdapter = new RecyclerViewAdapter(list);
              rec.setAdapter(recyclerViewAdapter);
  
  
  
  
          }else {
              Toast.makeText(getApplicationContext(),"Nothing to show",Toast.LENGTH_LONG).show();
          }
  
  
  
  
  
          FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
          fab.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
  
                  Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
                  startActivityForResult(intent, 000);
  
  
              }
          });
      }
  
  
  
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
          // if the result is capturing Image
          if (requestCode == 0) {
              if (resultCode == RESULT_OK) {
  
                  bitmap = (Bitmap) data.getExtras().get("data");
                   savePhoto(bitmap);
  
                  Toast.makeText(getApplicationContext(),"Success",Toast.LENGTH_LONG).show();
  
                  //Show
  
  
              }
          }
      }
  
      public void savePhoto(Bitmap bitmap){
          SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss");
          String  name = simpleDateFormat.format(new Date());
  
          String  directory = Environment.getExternalStorageDirectory().toString();
          File folder = new File(directory+"/PhotosOfSalman");
          folder.mkdirs();
  
          File myFile = new File(folder,name+".JPEG");
  
          try {
              FileOutputStream stream = new FileOutputStream(myFile);
              bitmap.compress(Bitmap.CompressFormat.JPEG,80,stream);
              stream.flush();
              stream.close();
  
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
  
      }
  
  }
  </code></pre>
  
  <p>Recycler View Adapter Class :- </p>
  
  <pre><code>public class RecyclerViewAdapter extends RecyclerView.Adapter&lt;ViewHolder&gt; {
  
      List&lt;Items&gt; list;
  
      public RecyclerViewAdapter(List&lt;Items&gt; list) {
          this.list = list;
      }
  
      @Override
      public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
  
          View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.layout,parent,false);
  
          return new ViewHolder(view);
      }
  
      @Override
      public void onBindViewHolder(ViewHolder holder, int position) {
  
  
          Items items=list.get(position);
  
            holder.name.setText(items.getName());
          holder.date.setText(items.getDate());
          holder.size.setText(items.getSize());
          holder.imageView.setImageBitmap(items.getImage());
  
      }
  
      @Override
      public int getItemCount() {
          return list.size();
      }
  }
  </code></pre>
  
  <p>Items Class :- </p>
  
  <pre><code>public class Items {
  
  
      Bitmap image;
      String name;
      String date;
      String size;
  
      public Bitmap getImage() {
          return image;
      }
  
      public void setImage(Bitmap image) {
          this.image = image;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public String getDate() {
          return date;
      }
  
      public void setDate(String date) {
          this.date = date;
      }
  
      public String getSize() {
          return size;
      }
  
      public void setSize(String size) {
          this.size = size;
      }
  
      public Items() {
  
      }
  
      public Items(Bitmap image, String name, String date, String size) {
  
          this.image = image;
          this.name = name;
          this.date = date;
          this.size = size;
      }
  }
  </code></pre>
  
  <p>Any help?</p>