This is a code to store data of a particular column in database to an array list.
ArrayList<String> mArrayList = new ArrayList<String>();
Cursor mCursor = null;
mCursor.moveToFirst();
while(!mCursor.isAfterLast()) {
mArrayList.add(mCursor.getString(mCursor.getColumnIndex(DBAdapter.SOURCE_NODE_ID)));
mCursor.moveToNext();
}
for(String d1:mArrayList) {
System.out.println(d1);}
but after running the program nothing gives in the output.
what is wrong in this program ?
thanks.
It will through null pointer exception: