Build 1.1_r1 (from source)

android.provider
Class LiveFolders

java.lang.Object
  extended by android.provider.LiveFolders
All Implemented Interfaces:
BaseColumns

public final class LiveFolders
extends Object
implements BaseColumns

A LiveFolder is a special folder whose content is provided by a ContentProvider. To create a live folder, two components are required:

Lifecycle

When a user wants to create a live folder, the system looks for all activities with the intent filter action ACTION_CREATE_LIVE_FOLDER and presents the list to the user. When the user chooses one of the activities, the activity is invoked with the ACTION_CREATE_LIVE_FOLDER action. The activity then creates the live folder and passes it back to the system by setting it as an activity result. The live folder is described by a content provider URI, a name, an icon and a display mode. Finally, when the user opens the live folder, the system queries the content provider to retrieve the folder's content.

Setting up the live folder activity

The following code sample shows how to write an activity that creates a live fodler:

 public static class MyLiveFolder extends Activity {
     public static final Uri CONTENT_URI = Uri.parse("content://my.app/live");


Field Summary
static String ACTION_CREATE_LIVE_FOLDER
          Activity Action: Creates a live folder.
static String DESCRIPTION
          Content provider column.
static int DISPLAY_MODE_GRID
          Displays a live folder's content in a grid.
static int DISPLAY_MODE_LIST
          Displays a live folder's content in a list.
static String EXTRA_LIVE_FOLDER_BASE_INTENT
          The name of the extra used to define the base Intent of a live folder.
static String EXTRA_LIVE_FOLDER_DISPLAY_MODE
          The name of the extra used to define the display mode of a live folder.
static String EXTRA_LIVE_FOLDER_ICON
          The name of the extra used to define the icon of a live folder.
static String EXTRA_LIVE_FOLDER_NAME
          The name of the extra used to define the name of a live folder.
static String ICON_BITMAP
          Content provider column.
static String ICON_PACKAGE
          Content provider column.
static String ICON_RESOURCE
          Content provider column.
static String INTENT
          Content provider column.
static String NAME
          Content provider column.
 
Fields inherited from interface android.provider.BaseColumns
_COUNT, _ID
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME

Content provider column.

Name of the live folder item.

Required.

Type: String.

See Also:
Constant Field Values

DESCRIPTION

public static final String DESCRIPTION

Content provider column.

Description of the live folder item. This value is ignored if the live folder's display mode is DISPLAY_MODE_GRID.

Optional.

Type: String.

See Also:
EXTRA_LIVE_FOLDER_DISPLAY_MODE, Constant Field Values

INTENT

public static final String INTENT

Content provider column.

Intent of the live folder item.

Optional if the live folder has a base intent.

Type: Intent.

See Also:
EXTRA_LIVE_FOLDER_BASE_INTENT, Constant Field Values

ICON_BITMAP

public static final String ICON_BITMAP

Content provider column.

Icon of the live folder item, as a custom bitmap.

Optional.

Type: Bitmap.

See Also:
Constant Field Values

ICON_PACKAGE

public static final String ICON_PACKAGE

Content provider column.

Package where to find the icon of the live folder item. This value can be obtained easily using Intent.ShortcutIconResource.fromContext(android.content.Context, int).

Optional.

Type: String.

See Also:
ICON_RESOURCE, Intent.ShortcutIconResource, Constant Field Values

ICON_RESOURCE

public static final String ICON_RESOURCE

Content provider column.

Resource name of the live folder item. This value can be obtained easily using Intent.ShortcutIconResource.fromContext(android.content.Context, int).

Optional.

Type: String.

See Also:
ICON_PACKAGE, Intent.ShortcutIconResource, Constant Field Values

DISPLAY_MODE_GRID

public static final int DISPLAY_MODE_GRID
Displays a live folder's content in a grid.

See Also:
EXTRA_LIVE_FOLDER_DISPLAY_MODE, Constant Field Values

DISPLAY_MODE_LIST

public static final int DISPLAY_MODE_LIST
Displays a live folder's content in a list.

See Also:
EXTRA_LIVE_FOLDER_DISPLAY_MODE, Constant Field Values

EXTRA_LIVE_FOLDER_NAME

public static final String EXTRA_LIVE_FOLDER_NAME
The name of the extra used to define the name of a live folder.

See Also:
ACTION_CREATE_LIVE_FOLDER, Constant Field Values

EXTRA_LIVE_FOLDER_ICON

public static final String EXTRA_LIVE_FOLDER_ICON
The name of the extra used to define the icon of a live folder.

See Also:
ACTION_CREATE_LIVE_FOLDER, Constant Field Values

EXTRA_LIVE_FOLDER_DISPLAY_MODE

public static final String EXTRA_LIVE_FOLDER_DISPLAY_MODE
The name of the extra used to define the display mode of a live folder.

See Also:
ACTION_CREATE_LIVE_FOLDER, DISPLAY_MODE_GRID, DISPLAY_MODE_LIST, Constant Field Values

EXTRA_LIVE_FOLDER_BASE_INTENT

public static final String EXTRA_LIVE_FOLDER_BASE_INTENT
The name of the extra used to define the base Intent of a live folder.

See Also:
ACTION_CREATE_LIVE_FOLDER, Constant Field Values

ACTION_CREATE_LIVE_FOLDER

public static final String ACTION_CREATE_LIVE_FOLDER
Activity Action: Creates a live folder.

Input: Nothing.

Output: An Intent representing the live folder. The intent must contain four extras: EXTRA_LIVE_FOLDER_NAME (value: String), EXTRA_LIVE_FOLDER_ICON (value: ShortcutIconResource), EXTRA_LIVE_FOLDER_URI (value: String) and EXTRA_LIVE_FOLDER_DISPLAY_MODE (value: int). The Intent can optionnally contain EXTRA_LIVE_FOLDER_BASE_INTENT (value: Intent).

See Also:
EXTRA_LIVE_FOLDER_NAME, EXTRA_LIVE_FOLDER_ICON, EXTRA_LIVE_FOLDER_DISPLAY_MODE, EXTRA_LIVE_FOLDER_BASE_INTENT, Intent.ShortcutIconResource, Constant Field Values

Build 1.1_r1 (from source)

Please submit a feedback, bug or feature