• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Possible to close spinner by code?

Maxxan

Lurker
Aug 19, 2010
7
0
Hi!
Iv'e got a spinner with a long click listner on the popup list (created a custom adapter and added a long click listner to each view, since spinner.setOnLongClickListener doesn't seem to do anything).

The problem is that if I add a long click listner, the spinner list doesn't close when selecting something. (But I can see that it responds to the click, because the radio button becomes orange when clicking.)

So either:
1. Can I close the spinner view by code? (I.e. set onClickListener on each view selecting that item and close the spinner list).

2. Call the default click listener some how? (On the other hand I see that something is happening since the radiobutton gets orange, just that the spinner don't select that item and closes the list).

3. Why does the default selection behaviour get screwed up when adding a long click listener? Can I stop that?

What I want is a menu with "Edit item" and "Delete item" when performing a long press.

Thanks!
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones