Database insertion not happening
- by Pramod Setlur
int i=0;
ContentValues values = null;
for ( SortedMap.Entry<Integer, String> entry : mapDefect.entrySet() ) {
if( i++ < count )
continue;
if( i < arrlst.size() ) {
values = new ContentValues();
Log.d("MAP", "Id :"+entry.getKey()+"Des :"+entry.getValue()+"Co :"+ arrlst.get(i));
values.put( MARKER_COORD, arrlst.get( i ) );
values.put( MARKER_ID, entry.getKey() );
values.put( DEFECT_DESCRIPTION, entry.getValue() );
values.put( IMAGE_ID_F, imageID + 1 );
Log.d( "Err", "in insertNewDefectsDescription" );
long rowId = db.insert( TABLE_DEFECTS, null, values );
long rowId1 = rowId;
i++;
}
}
So, I want to access the arraylist only after the count variable, which is why the:-
if(i++<count)
continue;
But, when I insert a break point at the 'insert' line, it is not working. The line is not executing at all, and hence the data is not being inserted into the database. What has gone wrong??
The 'values' are null.