How to make On Item Selected not automatically choose the first entry

后端 未结 4 609
小蘑菇
小蘑菇 2020-12-30 07:09

I have created a spinner which is automatically updated with appliance names when a person adds an appliance using an array adapter. I created an OnItemSelected method with

4条回答
  •  说谎
    说谎 (楼主)
    2020-12-30 07:59

    Does anyone know a way in which the first item on the list wont be automatically selected?

    There is always a selection on Spinner, and you cannot change that.

    IMHO, you should not be using a Spinner to trigger starting an activity.

    That being said, you can use a boolean to track whether this is the first selection event, and ignore it if it is.

提交回复
热议问题