Database insertion not happening

Posted by Pramod Setlur on Stack Overflow See other posts from Stack Overflow or by Pramod Setlur
Published on 2012-12-20T04:35:08Z Indexed on 2012/12/20 5:03 UTC
Read the original article Hit count: 201

Filed under:
|
|
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.

© Stack Overflow or respective owner

Related posts about java

Related posts about android