0

I'm writing an app that generates an image, which I'd like to allow the user to copy so they can share it with other people.

Unfortunately, there's no copy/cut/share menu appearing when I do a long click on the image. I thought the OS would naturally do this, as it comes up in many different apps. Am I supposed to write some code before it will do this, or is there something in the layout that needs to be changed?

I've tried to google this, but the search results are taken up by various clipboard manager apps.

Carlos
  • 5,991
  • 6
  • 43
  • 82

1 Answers1

2

The OS doesn't naturally do that. You need to implement a OnLongClickListener on the ImageView, and implement a floating context menu.

But if you want the user to be able to share things, I would suggest the ShareActionProvider instead.

ashishduh
  • 6,629
  • 3
  • 30
  • 35