I\'m sure this is asked plenty and i\'ve found some questions on here similar but none really got the coin dropping for me. I\'m hoping someone can help me out.
What
you can try this
ArrayAdapter SpinerAdapter;
String[] arrayItems = {"Strawberry","Chocolate","Vanilla"};
final int[] actualValues={10,20,30};
SpinerAdapter = new ArrayAdapter(this,
android.R.layout.simple_spinner_dropdown_item, arrayItems);
spinner.setAdapter(SpinerAdapter);
spinner.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView> arg0, View arg1,
int arg2, long arg3) {
int thePrice=actualValues[ arg2];
}
@Override
public void onNothingSelected(AdapterView> arg0) {
// TODO Auto-generated method stub
}
});