Here you can find the source of convertValueToList(CharSequence value, String[] options, int defaultValue)
public static final int convertValueToList(CharSequence value, String[] options, int defaultValue)
//package com.java2s; public class Main { public static final int convertValueToList(CharSequence value, String[] options, int defaultValue) { if (null != value) { for (int i = 0; i < options.length; i++) { if (value.equals(options[i])) { return i; }/*www. j a v a2s.c o m*/ } } return defaultValue; } }