1. Check out our companion app, Forums for Android! Download from Google Play

Possible to close spinner by code?

Discussion in 'Application Development' started by Maxxan, Aug 22, 2010.

  1. Maxxan

    Maxxan Member
    Thread Starter

    Aug 19, 2010
    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.



Share This Page