I come from an action script back ground and i am baffled by how to use arrays in java.
In my main activity i created an empty array called mIcons like so
private Array mIcons;
Now i want to set the value of that array by using a method from my DataBaseHelper class which looks like this:
public Array getHomeScreenIcons() {
Array iconList;
// Select All Query
String selectQuery = "SELECT * FROM " + homeIcons;
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);
// looping through all rows and adding to list
if (cursor.moveToFirst()) {
do {
iconList.push(Integer.parseInt(cursor.getString(0)));
} while (cursor.moveToNext());
}
Log.v(TAG, "List Created");
// return contact list
}
that bold line jumping out of the code is the problem so far.. how do i PUSH to my array
Then later i will want to run a for loop for the array from my main activity using.length