Code example for MatrixCursor

Methods: addRow

0
		// which has 4 columns: 
		// _id (integer), display1 (text), query (text), date (long) 
		// TODO perhaps we should display something smart @ display2 
		 
		// we'll simulate this through a MatrixCursor. 
		MatrixCursor cursor = new MatrixCursor(new String[]{SearchManager.SUGGEST_COLUMN_TEXT_1, SearchManager.SUGGEST_COLUMN_QUERY, "_id"});
		cursor.addRow(formatRow(query, preferences.getString("bang_1_preference", "!google"), 0));
		cursor.addRow(formatRow(query, preferences.getString("bang_2_preference", "!amazon"), 1));
		cursor.addRow(formatRow(query, preferences.getString("bang_3_preference", "!bing"), 2));
		cursor.addRow(formatRow(query, preferences.getString("bang_4_preference", "!news"), 2));
		 
		return cursor;
	} 
	 
	private Object[] formatRow(String query, String bang, int index)
	{ 
		return new Object[]{bang + " " + query, bang + " " + query, index}; 
	} 
 
	@Override 
	public int update(Uri uri, ContentValues values, String selection,