1

Possible Duplicate:
Android - EditTexts in Gallery show strange behaviour when being (long)-clicked

I feel like I should ask my previous question again more precisely and with less blabla.

I created a gallery from Google's example:
http://developer.android.com/guide/tutorials/views/hello-gallery.html

Instead of showing images, my Adapter contains a bunch of EditTexts. Now I want their context menues (with "select all", "copy" and so on) to appear on a long click (as it does usually). How can I achieve that?
I have tried setting the onItemLongClickListener and let it call showContextMenu() on the currently shown view, but that runs into a StackOverflowError:

08-13 16:02:36.062: ERROR/AndroidRuntime(3400): FATAL EXCEPTION: main
java.lang.StackOverflowError
 at android.widget.AdapterView.getPositionForView(AdapterView.java:581)
 at android.widget.Gallery.showContextMenuForChild(Gallery.java:1049)
 at android.view.View.showContextMenu(View.java:2520)
 at de.test.gallery2.Main$1.onItemLongClick(Main.java:51)
 at android.widget.Gallery.dispatchLongPress(Gallery.java:1074)
 at android.widget.Gallery.showContextMenuForChild(Gallery.java:1055)

[now it continously restarts from the 5th line (View.showContextMenu())]

I have also tried to registerForContextMenu() my gallery and the views, but it failed as well.
Does anyone have a clou about what to do here?
Lots of thanks in anticipation

m1ntf4n

Community
  • 1
  • 1
m1ntf4n
  • 493
  • 2
  • 14
  • Instead of paraphrasing your previous question and posting it as new, you should instead edit the original question in order to make it clearer. Posting multiple versions of the same question just increases the amount of noise on SO. – glorifiedHacker Aug 13 '11 at 21:23
  • Yes, you're right, that was a stupid idea. Just didn't take that option into consideration. I'm sorry. – m1ntf4n Aug 13 '11 at 22:05

0 Answers0