How to send an image onclick in a chat application : I have an application which includes chatting, I'm able to send texts however what I want to achieve is to send images whenever I click on one of the images in a gridview, so using the below code whenever I click on an image it displays in the chat a text however it's not showing as an image at all, can you please tell me what do I need to do to achieve this

smiles_items_layout.xml

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <ImageView android:id="@+id/smile_image_view"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_gravity="center"/>


    </LinearLayout>

BottomSheetDialog_Smiles.java

    public class ImageAdapter2 extends BaseAdapter {
    private Context mContext;
    private final int[] mThumbIds;
    String[] mThumbIdsString = null;



    public ImageAdapter2(Context c, int[] mThumbIds ,  String[] mThumbIdsString) 
    {
    mContext = c;
    this.mThumbIds = mThumbIds;
    this.mThumbIdsString = mThumbIdsString;
    }

        @Override
        public int getCount() {
            return mThumbIds.length & mThumbIdsString.length;
        }

        @Override
        public Object getItem(int position) {
            return position;
        }

        @Override
        public long getItemId(int position) {
            return position;
        }


        public class Holder {
            ImageView img;
        }



        @Override
        public View getView(final int position, final View convertView, 
        ViewGroup parent) {

            final Holder holder = new Holder();
            LayoutInflater inflater = (LayoutInflater) 
            getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            grid = inflater.inflate(R.layout.smiles_items_layout, null);
            null);

            holder.img = (ImageView) grid.findViewById(R.id.smile_image_view);
            holder.img.setImageResource(mThumbIds[position]);


            gridView2.setOnItemClickListener(new 
            AdapterView.OnItemClickListener() {
                Drawable drawable;

                @Override
                public void onItemClick(AdapterView<?> adapterView, View view, 
                int i, long l) {
                    JSONDictionary imageChat = new JSONDictionary();
                    LinearLayout layout= (LinearLayout)view;
                    ImageView imageView = (ImageView) layout.getChildAt(0);
                    imageView.getDrawable();
                    imageChat.put("message", imageView);
                    Communicator.getInstance().emit("new chat message", 
                    imageChat);
                }
            });

            return grid;

        }

    }