Code example for StringBuilder

Methods: append, toString

0
     * @param hash Hash to search for 
     */ 
    public Cursor returnItemBasedOnHash(String hash) throws SQLException {
        //Uri newUri = HASHES_URI_STRING_BASE.withAppendedPath(HASHES_URI_STRING_BASE, hash); 
        //Cursor c = cr.query(newUri, ALL_PROJECTION, null, null, null); 
        Cursor c = mDb.query(true, DATABASE_TABLE, ALL_PROJECTION, KEY_MESSAGE_HASH + " = '" + hash + "'", null, null, null, null, null);
        if (c != null) {
            c.moveToFirst();
        } 
        return c;
    } 
 
    /** 
     * Delete an item by the id  
     */ 
    public int deleteById(long id) {
        //Uri uri = ContentUris.withAppendedId(MESSAGES_URI_ID_BASE, id); 
        return mDb.delete(DATABASE_TABLE, KEY_ID + " = " + id, null);
    } 
 
    /**