0
spCountries.setOnItemSelectedListener(new OnItemSelectedListener() {

    @Override
    public void onItemSelected(AdapterView<?> adapter, View v,
                               int position, long id) {
        switch (position)
        {
            case 0:
                startActivity(new Intent(NagpurSem.this, ComputerWorkshop.class));
        }
    }

    @Override
    public void onNothingSelected(AdapterView<?> arg0) {
        // TODO Auto-generated method stub

    }
});

I want it to wait until the user will select something from the spinner, but instead, it directly goes to the third activity. Please help me.

Jinesh Francis
  • 3,377
  • 3
  • 22
  • 37
  • Please comment the switch case and check whether it jumps to third activity without waiting for spinner to select. – Shadow Droid Sep 12 '16 at 05:25
  • Check this link http://stackoverflow.com/questions/2562248/how-to-keep-onitemselected-from-firing-off-on-a-newly-instantiated-spinner – SHIVANI GARG Sep 12 '16 at 05:48

0 Answers0