FileDocCategorySizeDatePackage
ApplicationInfo.javaAPI DocAndroid 1.5 API4066Wed May 06 22:42:46 BST 2009com.android.launcher

ApplicationInfo

public class ApplicationInfo extends ItemInfo
Represents a launchable application. An application is made of a name (or title), an intent and an icon.

Fields Summary
CharSequence
title
The application name.
android.content.Intent
intent
The intent used to start the application.
android.graphics.drawable.Drawable
icon
The application icon.
boolean
filtered
When set to true, indicates that the icon has been resized.
boolean
customIcon
Indicates whether the icon comes from an application's resource (if false) or from a custom Bitmap (if true.)
Intent.ShortcutIconResource
iconResource
If isShortcut=true and customIcon=false, this contains a reference to the shortcut icon as an application's resource.
Constructors Summary
ApplicationInfo()

        itemType = LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT;
    
public ApplicationInfo(ApplicationInfo info)

        super(info);
        title = info.title.toString();
        intent = new Intent(info.intent);
        if (info.iconResource != null) {
            iconResource = new Intent.ShortcutIconResource();
            iconResource.packageName = info.iconResource.packageName;
            iconResource.resourceName = info.iconResource.resourceName;
        }
        icon = info.icon;
        filtered = info.filtered;
        customIcon = info.customIcon;
    
Methods Summary
voidonAddToDatabase(android.content.ContentValues values)

        super.onAddToDatabase(values);

        String titleStr = title != null ? title.toString() : null;
        values.put(LauncherSettings.Favorites.TITLE, titleStr);

        String uri = intent != null ? intent.toURI() : null;
        values.put(LauncherSettings.Favorites.INTENT, uri);

        if (customIcon) {
            values.put(LauncherSettings.Favorites.ICON_TYPE,
                    LauncherSettings.Favorites.ICON_TYPE_BITMAP);
            Bitmap bitmap = ((FastBitmapDrawable) icon).getBitmap();
            writeBitmap(values, bitmap);
        } else {
            values.put(LauncherSettings.Favorites.ICON_TYPE,
                    LauncherSettings.Favorites.ICON_TYPE_RESOURCE);
            if (iconResource != null) {
                values.put(LauncherSettings.Favorites.ICON_PACKAGE, iconResource.packageName);
                values.put(LauncherSettings.Favorites.ICON_RESOURCE, iconResource.resourceName);
            }
        }
    
final voidsetActivity(android.content.ComponentName className, int launchFlags)
Creates the application intent based on a component name and various launch flags. Sets {@link #itemType} to {@link LauncherSettings.Favorites#ITEM_TYPE_APPLICATION}.

param
className the class name of the component representing the intent
param
launchFlags the launch flags

        intent = new Intent(Intent.ACTION_MAIN);
        intent.addCategory(Intent.CATEGORY_LAUNCHER);
        intent.setComponent(className);
        intent.setFlags(launchFlags);
        itemType = LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
    
public java.lang.StringtoString()

        return title.toString();