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 EditText
s. 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