IT. Expert System.

Android Reference

LiveFolders


android.provider

Class LiveFolders

  • All Implemented Interfaces:
    BaseColumns

    Deprecated.
    Live folders are no longer supported by Android. These have been replaced by the new AppWidget Collection APIs introduced in Build.VERSION_CODES.HONEYCOMB. These provide all of the features of live folders plus many more. The use of live folders is greatly discouraged because of security issues they introduce -- publishing a live folder requires making all data show for the live folder available to all applications with no permissions protecting it.

    @Deprecated
    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 folder:

     public static class MyLiveFolder extends Activity {
         public static final Uri CONTENT_URI = Uri.parse("content://my.app/live");
    
         protected void onCreate(Bundle savedInstanceState) {
             super.onCreate(savedInstanceState);
    
             final Intent intent = getIntent();
             final String action = intent.getAction();
    
             if (LiveFolders.ACTION_CREATE_LIVE_FOLDER.equals(action)) {
                 setResult(RESULT_OK, createLiveFolder(this, CONTENT_URI, "My LiveFolder",
                         R.drawable.ic_launcher_contacts_phones));
             } else {
                 setResult(RESULT_CANCELED);
             }
    
             finish();
         }
    
         private static Intent createLiveFolder(Context context, Uri uri, String name,
                 int icon) {
    
             final Intent intent = new Intent();
    
             intent.setData(uri);
             intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_NAME, name);
             intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_ICON,
                     Intent.ShortcutIconResource.fromContext(context, icon));
             intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_DISPLAY_MODE, LiveFolders.DISPLAY_MODE_LIST);
    
             return intent;
         }
     }
     

    The live folder is described by an Intent as follows:

    Component Type Description Required
    URI URI The ContentProvider URI Yes
    EXTRA_LIVE_FOLDER_NAME Extra String The name of the live folder Yes
    EXTRA_LIVE_FOLDER_ICON Extra Intent.ShortcutIconResource The icon of the live folder Yes
    EXTRA_LIVE_FOLDER_DISPLAY_MODE Extra int The display mode of the live folder. The value must be either DISPLAY_MODE_GRID or DISPLAY_MODE_LIST. Yes
    EXTRA_LIVE_FOLDER_BASE_INTENT Extra Intent When the user clicks an item inside a live folder, the system will either fire the intent associated with that item or, if present, the live folder's base intent with the id of the item appended to the base intent's URI. No

    Setting up the content provider

    The live folder's content provider must, upon query, return a Cursor whose columns match the following names:

    Column Type Description Required
    NAME String The name of the item Yes
    DESCRIPTION String The description of the item. The description is ignored when the live folder's display mode is DISPLAY_MODE_GRID. No
    INTENT Intent The intent to fire when the item is clicked. Ignored when the live folder defines a base intent. No
    ICON_BITMAP Bitmap The icon for the item. When this column value is not null, the values for the columns ICON_PACKAGE and ICON_RESOURCE must be null. No
    ICON_PACKAGE String The package of the item's icon. When this value is not null, the value for the column ICON_RESOURCE must be specified and the value for the column ICON_BITMAP must be null. No
    ICON_RESOURCE String The resource name of the item's icon. When this value is not null, the value for the column ICON_PACKAGE must be specified and the value for the column ICON_BITMAP must be null. No


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 400 / 158678062. Delta: 0.01988 с