1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00
k-9/src/com/fsck/k9/activity/setup/SpinnerOption.java

34 lines
724 B
Java
Raw Normal View History

/**
*
*/
2008-10-27 21:22:17 -04:00
package com.fsck.k9.activity.setup;
import android.widget.Spinner;
public class SpinnerOption {
public Object value;
public String label;
public static void setSpinnerOptionValue(Spinner spinner, Object value) {
for (int i = 0, count = spinner.getCount(); i < count; i++) {
SpinnerOption so = (SpinnerOption)spinner.getItemAtPosition(i);
if (so.value.equals(value)) {
spinner.setSelection(i, true);
return;
}
}
}
public SpinnerOption(Object value, String label) {
this.value = value;
this.label = label;
}
@Override
public String toString() {
return label;
}
}