1. Are you ready for the Galaxy S20? Here is everything we know so far!

Android Spinner setOnItemSelectedListener

Discussion in 'Android Development' started by Mingi, Jun 10, 2019.

  1. Mingi

    Mingi Lurker
    Thread Starter

    Is there a way to execute when the same Position is selected?

    For example, if 0 is currently selected, selecting 0 again will cause the same event to occur again.
     


  2. Brian Berry

    Brian Berry Well-Known Member

    use a switch statement

    switch(selected){
    case 0:
    //do something
    break;

    case 1:
    //do something
    break;
    }
     
    #2 Brian Berry, Jun 10, 2019
    Last edited: Jun 11, 2019
Loading...

Share This Page

Loading...