title: How to get Drawable image name in a recycler view
body: <p>I have a list of images in a recycler view.I want to display the name of image used in background. But when i click any image  it returns <strong>"android.graphics.drawable.BitmapDrawable@1cca205"</strong> in log.How to display the image name? I want to use this image name in switch case and perform some task. </p>
  
  <p>Main Activity.java </p>
  
  <pre><code>public static String[] AddCustomitems = {"Blink single message", "Blink double message", "Message", "Scroll", "Split", "Temp"};
      public static final Integer[] customviewsDrawable = {R.drawable.custom_blink, R.drawable.custom_blink_double, R.drawable.custom_message, R.drawable.custom_scroll, R.drawable.custom_split_double, R.drawable.temp};
      public static final Integer defaultAdd =R.drawable.custom_add;
      ArrayList&lt;ItemModel&gt; arrayList = new ArrayList&lt;&gt;();
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          arrayList.add(new ItemModel(defaultAdd));
          for(int i =0;i&lt;customviewsDrawable.length;i++){
              ItemModel itemModel = new ItemModel();
              arrayList.add(new ItemModel(customviewsDrawable[i]));
          }
          recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
          //Set RecyclerView type according to intent value
          recyclerView.setLayoutManager(new LinearLayoutManager(MainActivity.this, LinearLayoutManager.HORIZONTAL, false));
          adapter = new MyAdapter(MainActivity.this, arrayList);
          recyclerView.setAdapter(adapter);// set adapter on recyclerview
          adapter.notifyDataSetChanged();// Notify the adapter
  }
  </code></pre>
  
  <p>MyAdapter.java</p>
  
  <pre><code> @Override
      public void onBindViewHolder(final RecyclerViewHolder holder, final int position) {
          final ItemModel model = arrayList.get(holder.getAdapterPosition());
  
          final RecyclerViewHolder mainHolder = (RecyclerViewHolder) holder;// holder
  
          Bitmap image = BitmapFactory.decodeResource(context.getResources(), model.getImage());// This will convert drawbale image into
          // bitmap
          mainHolder.imageview.setImageBitmap(Bitmap.createScaledBitmap(image, 330, 500, false));
          mainHolder.imageview.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Log.v("Image name:", String.valueOf(mainHolder.imageview.getDrawable())); 
              }
          });
          setAnimation(holder.cardView, position);
      }
  </code></pre>