Bit of a strange issue here,
The spinner items show perfectly and when an item is selected, that item is then shown on the spinner. All is well except for when I select on option - KILOGRAM (see below), it is programatically selected but the "kg" symbol that should be display is not, there is just an empty spinner
I have 3 separate Enum values
public enum Unit
{
// Different unit names and symbols
PERCENTAGE ("%", 0),
KILOGRAMS ("kg", 1),
POUNDS ("lb", 2);
private String symbol;
private int position;
Unit(String symbol, int position)
{
this.symbol = symbol;
this.position = position;
}
// Get symbol
public String getSymbol()
{
return symbol;
}
}
They populate the spinner via the following code.
// Set Unit spinners
units = new ArrayList<String>();
for (Unit unit : Unit.values())
{
units.add(unit.getSymbol());
}
ArrayAdapter <String> unitAdapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_spinner_dropdown_item, units);
sSuccessUnit.setAdapter(unitAdapter);
And that's about it, it seems to be very strange. I tried adding another KILOGRAMS enum and therefore had two but I had the same problem for both. I tried adding another POUNDS enum and just like before that worked perfectly. I also tried to add OUNCES ("oz") and that didn't work either..
Any ideas?
EDIT: To clear that question up a little bit.. Everything that is meant to be shown ("%","kg","lb")
is shown. When I select "%" and "lb", that is what I see selected in the spinner, when I select "kg", the spinner shows " ", an empty selection