Getting Image from ImageView

后端 未结 3 522
萌比男神i
萌比男神i 2020-12-08 20:03

I have a gallery that shows an array of images, when clicked they are displayed in an imageview. I want to be able to SHARE the image that is currently being displayed in an

3条回答
  •  我在风中等你
    2020-12-08 20:36

        l.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView parent, View view, int position, long id) {
                TextView textView=(TextView)view.findViewById(R.id.textView);
                ImageView imageView=(ImageView)view.findViewById(R.id.imageView);
                String textViewString=textView.getText().toString();
                Bitmap image=((BitmapDrawable)imageView.getDrawable()).getBitmap();
    
                DialogClass dialogClass=new DialogClass(MainActivity.this,image,textViewString);
                dialogClass.show();
            }
        });
    

提交回复
热议问题