Spinner Switch Case Problem

后端 未结 1 737
春和景丽
春和景丽 2021-01-28 23:53

EDIT: i have added in all of my code (excluding package and imports.....) and if i try to run it it crashes...... any ideas why?

public class BaseConverter exten         


        
1条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-29 00:27

    So i figured it out. you need to make the array a STRING array and the use: ArrayAdapter adapter = new ArrayAdapter

    etc.....

    then use

    Integer.parseInt(parent.getItemAtPosition(position).toString());
    

    to find the numerical value of whatever you selected. NOTE: it must be all numerical or it will give you an error.

    0 讨论(0)
提交回复
热议问题