private void onInit() { String excludedLanguages = Settings.getExcludedLanguages(); if (null == excludedLanguages) { return; } String[] languages = excludedLanguages.split("x"); int iLength = languages.length; int jLength = LANGUAGES.length; for (int i = 0, j = 0; i < iLength; i++) { String language = languages[i]; if (!isDecimal(language)) { continue; } for (; j < jLength; j++) { String pattern = LANGUAGES[j]; if (pattern.equals(language)) { // Get it int row = (j + 1) / 3; int column = (j + 1) % 3; mSelections[row][column] = true; break; } } } }