public boolean checkAllQueriedMessages(boolean check,String query){
  if (query == null || query.length() == 0) {
    return checkAllMessages(check,false);
  }
  SQLiteDatabase db=getWritableDatabase();
  if (db != null) {
    String parentOnly=" AND (" + COL_BIGPARENT + " IS NULL OR "+ COL_BIGPARENT+ " NOT IN (SELECT "+ COL_MESSAGE_ID+ " FROM "+ TABLE+ " WHERE "+ COL_DELETED+ "="+ FALSE+ ") AND "+ COL_PARENT+ " NOT IN (SELECT "+ COL_MESSAGE_ID+ " FROM "+ TABLE+ " WHERE "+ COL_DELETED+ "="+ FALSE+ "))";
    db.execSQL("UPDATE " + TABLE + " SET "+ COL_CHECKED+ "="+ (check ? TRUE : FALSE)+ " WHERE "+ COL_DELETED+ " ="+ FALSE+ " "+ query+ parentOnly+ ";");
    return true;
  }
  return false;
}

public boolean checkAllQueriedMessages ( boolean check , String query ) { if ( query == null || query . length ( ) == 0 ) { return checkAllMessages ( check , false ) ; } SQLiteDatabase db = getWritableDatabase ( ) ; if ( db != null ) { String parentOnly = " AND (" + COL_BIGPARENT + " IS NULL OR " + COL_BIGPARENT + " NOT IN (SELECT " + COL_MESSAGE_ID + " FROM " + TABLE + " WHERE " + COL_DELETED + "=" + FALSE + ") AND " + COL_PARENT + " NOT IN (SELECT " + COL_MESSAGE_ID + " FROM " + TABLE + " WHERE " + COL_DELETED + "=" + FALSE + "))" ; db . execSQL ( "UPDATE " + TABLE + " SET " + COL_CHECKED + "=" + ( check ? TRUE : FALSE ) + " WHERE " + COL_DELETED + " =" + FALSE + " " + query + parentOnly + ";" ) ; return true ; } return false ; }
set the checked state of the all messages as true or false
