I am trying to implement swipe to delete in RecyclerView. Everything seems to be working fine except drawing a delete icon below the item that\'s being swiped.
Thi
The error is because of the drawable might be a Vector.
Drawable drawable = ContextCompat.getDrawable(StreamActivity.this,R.drawable.ic_close)
Bitmap icon = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(icon);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);