Code example for SparseBooleanArray

Methods: put

         * We use the previous bookmarked shortcuts array to filter out those 
         * shortcuts that had bookmarks before this method call, and don't after 
         * (so we can set the preferences to be without bookmarks). 
        SparseBooleanArray noLongerBookmarkedShortcuts = mBookmarkedShortcuts;
        SparseBooleanArray newBookmarkedShortcuts = new SparseBooleanArray(); 
        while (c.moveToNext()) {
            char shortcut = Character.toLowerCase((char) c.getInt(COLUMN_SHORTCUT));
            if (shortcut == 0) continue;
            ShortcutPreference pref = getOrCreatePreference(shortcut);
            pref.setTitle(Bookmarks.getTitle(this, c));
            newBookmarkedShortcuts.put(shortcut, true);
            if (noLongerBookmarkedShortcuts != null) {
                // After this loop, the shortcuts with value true in this array 
                // will no longer have bookmarks 
                noLongerBookmarkedShortcuts.put(shortcut, false);