Methods Summary |
---|
public int | getApplicationFlags()Returns the application flags from the ApplicationInfo of the activity.
return mActivityInfo.applicationInfo.flags;
|
public ApplicationInfo | getApplicationInfo()Returns the application info for the appliction this activity belongs to.
return mActivityInfo.applicationInfo;
|
public android.graphics.drawable.Drawable | getBadgedIcon(int density)Returns the activity icon with badging appropriate for the profile.
int iconRes = mActivityInfo.getIconResource();
Resources resources = null;
Drawable originalIcon = null;
try {
resources = mPm.getResourcesForApplication(mActivityInfo.applicationInfo);
try {
if (density != 0) {
originalIcon = resources.getDrawableForDensity(iconRes, density);
}
} catch (Resources.NotFoundException e) {
}
} catch (NameNotFoundException nnfe) {
}
if (originalIcon == null) {
originalIcon = mActivityInfo.loadIcon(mPm);
}
if (originalIcon instanceof BitmapDrawable) {
return mPm.getUserBadgedIcon(originalIcon, mUser);
} else {
Log.e(TAG, "Unable to create badged icon for " + mActivityInfo);
}
return originalIcon;
|
public android.content.ComponentName | getComponentName()Returns the component name of this activity.
return mComponentName;
|
public long | getFirstInstallTime()Returns the time at which the package was first installed.
return mFirstInstallTime;
|
public android.graphics.drawable.Drawable | getIcon(int density)Returns the icon for this activity, without any badging for the profile.
// TODO: Use density
return mActivityInfo.loadIcon(mPm);
|
public java.lang.CharSequence | getLabel()Retrieves the label for the activity.
return mActivityInfo.loadLabel(mPm);
|
public java.lang.String | getName()Returns the name for the acitivty from android:name in the manifest.
return mActivityInfo.name;
|
public android.os.UserHandle | getUser()Returns the user handle of the user profile that this activity belongs to. In order to
persist the identity of the profile, do not store the UserHandle. Instead retrieve its
serial number from UserManager. You can convert the serial number back to a UserHandle
for later use.
return mUser;
|