Build 1.0_r1(from source)

android.provider
Class Settings.Bookmarks

java.lang.Object
  extended by android.provider.Settings.Bookmarks
All Implemented Interfaces:
BaseColumns
Enclosing class:
Settings

public static final class Settings.Bookmarks
extends Object
implements BaseColumns

User-defined bookmarks and shortcuts. The target of each bookmark is an Intent URL, allowing it to be either a web page or a particular application activity.


Field Summary
static Uri CONTENT_URI
          The content:// style URL for this table
static String FOLDER
          Arbitrary string (displayed to the user) that allows bookmarks to be organized into categories.
static String ID
          The row ID.
static String INTENT
          The Intent URL of the bookmark, describing what it points to.
static String ORDERING
          The order in which the bookmark should be displayed
static String SHORTCUT
          Optional shortcut character associated with this bookmark.
static String TITLE
          Descriptive name of the bookmark that can be displayed to the user.
 
Fields inherited from interface android.provider.BaseColumns
_COUNT, _ID
 
Constructor Summary
Settings.Bookmarks()
           
 
Method Summary
static Uri add(ContentResolver cr, Intent intent, String title, String folder, char shortcut, int ordering)
          Add a new bookmark to the system.
static Intent getIntentForShortcut(ContentResolver cr, char shortcut)
          Convenience function to retrieve the bookmarked Intent for a particular shortcut key.
static CharSequence labelForFolder(Resources r, String folder)
          Return the folder name as it should be displayed to the user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_URI

public static final Uri CONTENT_URI
The content:// style URL for this table


ID

public static final String ID
The row ID.

Type: INTEGER

See Also:
Constant Field Values

TITLE

public static final String TITLE
Descriptive name of the bookmark that can be displayed to the user.

Type: TEXT

See Also:
Constant Field Values

FOLDER

public static final String FOLDER
Arbitrary string (displayed to the user) that allows bookmarks to be organized into categories. There are some special names for standard folders, which all start with '@'. The label displayed for the folder changes with the locale (via labelForFolder(android.content.res.Resources, java.lang.String)) but the folder name does not change so you can consistently query for the folder regardless of the current locale.

Type: TEXT

See Also:
Constant Field Values

INTENT

public static final String INTENT
The Intent URL of the bookmark, describing what it points to. This value is given to Intent.getIntent(java.lang.String) to create an Intent that can be launched.

Type: TEXT

See Also:
Constant Field Values

SHORTCUT

public static final String SHORTCUT
Optional shortcut character associated with this bookmark.

Type: INTEGER

See Also:
Constant Field Values

ORDERING

public static final String ORDERING
The order in which the bookmark should be displayed

Type: INTEGER

See Also:
Constant Field Values
Constructor Detail

Settings.Bookmarks

public Settings.Bookmarks()
Method Detail

getIntentForShortcut

public static Intent getIntentForShortcut(ContentResolver cr,
                                          char shortcut)
Convenience function to retrieve the bookmarked Intent for a particular shortcut key.

Parameters:
cr - The ContentResolver to query.
shortcut - The shortcut key.
Returns:
Intent The bookmarked URL, or null if there is no bookmark matching the given shortcut.

add

public static Uri add(ContentResolver cr,
                      Intent intent,
                      String title,
                      String folder,
                      char shortcut,
                      int ordering)
Add a new bookmark to the system.

Parameters:
cr - The ContentResolver to query.
intent - The desired target of the bookmark.
title - Bookmark title that is shown to the user; null if none.
folder - Folder in which to place the bookmark; null if none.
shortcut - Shortcut that will invoke the bookmark; 0 if none. If this is non-zero and there is an existing bookmark entry with this same shortcut, then that existing shortcut is cleared (the bookmark is not removed).
Returns:
The unique content URL for the new bookmark entry.

labelForFolder

public static CharSequence labelForFolder(Resources r,
                                          String folder)
Return the folder name as it should be displayed to the user. This takes care of localizing special folders.

Parameters:
r - Resources object for current locale; only need access to system resources.
folder - The value found in the FOLDER column.
Returns:
CharSequence The label for this folder that should be shown to the user.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature