This is my code from my android project where i would want to store each string element from the cursor to a string array, but i keep getting NullPointer Exception.
The Code is Down Below, series2Strings[] is the string array i have defined,
int k=0;
if(cur.moveToFirst()){
while(!cur.isAfterLast()){
Log.i("String", " "+ k + " " + cur.getString(1));
series2Strings[k]=cur.getString(1);
k++;
cur.moveToNext();
}
}
cur.close();
The data is available at the cursor because i have checked it in the logcat by using the log statement. Can anyone please point what's going wrong.
series2Stringsis not initialized