BoD/android-contentprovider-generator

how to update the value

gevikv opened this issue · 1 comments

how can i update only one row instead of all?

PhoneSelection where=new PhoneSelection() ;
where.name(name);
where.uri();
PhoneContentValues values =new PhoneContentValues() ;

    PhoneCursor cursor = where .query(context .getContentResolver());
   // ContentUris.withAppendedId(PhoneColumns.CONTENT_URI,)
    while(cursor.moveToNext()){
         smsCount= cursor.getSmsCount();
        // id=

      }

    values .putSmsCount(smsCount) ;
   context.getContentResolver().update(where.uri(),values.values(),null,null);

thanks

BoD commented

Hi.
To select only one row for which you know the id, simply use the id(long) method on the Selection object.