Reputation: 1368
I know it is possible to make text
in textView
selectable (for copy and paste) using android:textIsSelectable="true"
.
I want to make image
in imageView
selectable (for copy and paste as shown in the image below). Does anyone have a clue?
Upvotes: 1
Views: 900
Reputation: 413
The Android OS does not support this natively. You will have to register your ImageView with registerForContextMenu. More info about context menus here.
Then you can get the ImageView's bitmap by doing ((BitmapDrawable)yourImageView.getDrawable()).getBitmap();
See here for more information on copying the bitmap onto the clipboard.
As a final comment I will say most Android users, myself included, would not expect to be able to long tap an image to copy it onto their clipboard unless there was some indication that it was possible in your app.
Upvotes: 1