Android 4.0+ I have 10 spinners, have loaded into an array I am trying to associate with 10 ArrayAdapters, using an array of ArrayAdapters. Not working...
ArrayAdapter<CharSequence>[] adpPPI;
for (int ppiCntr = 0; ppiCntr < 10; ppiCntr++) {
//NOTE 1: next statement gets resource id, works ok
int res_array = getResources().getIdentifier(
"com.my:array/ppi" + Integer.toString(ppiCntr + 1) + "_array", null, null);
// NOTE 2: creating the array adapter provides null pointer error.
// because I need to initialize it somehow? how?
adpPPI[ppiCntr] = ArrayAdapter.createFromResource(
getApplicationContext(), res_array, R.layout.psm_simple_spinner_item);
}