I have an a String Array called Collections.
String[] Collections; I have integer values saved in my db table. I want to grab the integer values from my database column called specific_collections.
and set that to an integer array SpecificCollections.
So, I want to set it up like this:
String[] Collections = 0; Integer[] SpecificCollections = getColumnValuesFromSpecificCollectionsColumn(); After I set them to an integer array, I want to parse the integer array and save each int value to my String Array that is something of the form below:
Collections = new String[]{Collection.SpecificCollections.fromInt(SpecificCollections[i]).getString()}; where Specific Collections is the array of integers from db.
EDIT: Here's what I have so far but it's only populating the list with one int?
ArrayList<Integer> regionList= new ArrayList<Integer>(); Cursor cursorTwo = sqLiteDatabase.rawQuery("SELECT DISTINCT region FROM collection", null); if (cursorTwo != null && cursorTwo.getCount() != 0) { cursorTwo.moveToFirst(); while (!cursorTwo.isAfterLast()) { regionList.add(cursorTwo.getInt(0)); cursorTwo.moveToNext(); } } for (Integer inte : regionList){ regions = new String[]{Collection.Regions.fromInt(inte).getString()}; } Is below the correct way to iterate through an array list and pass the distinct integers inside the fromInt() method?