Added in API level 5

LabeledIntent


open class LabeledIntent : Intent
kotlin.Any
   ↳ android.content.Intent
   ↳ android.content.pm.LabeledIntent

A special subclass of Intent that can have a custom label/icon associated with it. Primarily for use with Intent.ACTION_CHOOSER.

Summary

Inherited constants
Public constructors
LabeledIntent(origIntent: Intent!, sourcePackage: String!, labelRes: Int, icon: Int)

Create a labeled intent from the given intent, supplying the label and icon resources for it.

LabeledIntent(origIntent: Intent!, sourcePackage: String!, nonLocalizedLabel: CharSequence!, icon: Int)

Create a labeled intent from the given intent, supplying a textual label and icon resource for it.

LabeledIntent(sourcePackage: String!, labelRes: Int, icon: Int)

Create a labeled intent with no intent data but supplying the label and icon resources for it.

LabeledIntent(sourcePackage: String!, nonLocalizedLabel: CharSequence!, icon: Int)

Create a labeled intent with no intent data but supplying a textual label and icon resource for it.

Public methods
open Int

Return any resource identifier that has been given for the label icon.

open Int

Return any resource identifier that has been given for the label text.

open CharSequence!

Return any concrete text that has been given for the label text.

open String!

Return the name of the package holding label and icon resources.

open Drawable!

Retrieve the icon associated with this object.

open CharSequence!

Retrieve the label associated with this object.

open Unit

open Unit
writeToParcel(dest: Parcel, parcelableFlags: Int)

Inherited functions
Properties
static Parcelable.Creator<LabeledIntent!>

Public constructors

LabeledIntent

Added in API level 5
LabeledIntent(
    origIntent: Intent!,
    sourcePackage: String!,
    labelRes: Int,
    icon: Int)

Create a labeled intent from the given intent, supplying the label and icon resources for it.

Parameters
origIntent Intent!: The original Intent to copy.
sourcePackage String!: The package in which the label and icon live.
labelRes Int: Resource containing the label, or 0 if none.
icon Int: Resource containing the icon, or 0 if none.

LabeledIntent

Added in API level 5
LabeledIntent(
    origIntent: Intent!,
    sourcePackage: String!,
    nonLocalizedLabel: CharSequence!,
    icon: Int)

Create a labeled intent from the given intent, supplying a textual label and icon resource for it.

Parameters
origIntent Intent!: The original Intent to copy.
sourcePackage String!: The package in which the label and icon live.
nonLocalizedLabel CharSequence!: Concrete text to use for the label.
icon Int: Resource containing the icon, or 0 if none.

LabeledIntent

Added in API level 5
LabeledIntent(
    sourcePackage: String!,
    labelRes: Int,
    icon: Int)

Create a labeled intent with no intent data but supplying the label and icon resources for it.

Parameters
sourcePackage String!: The package in which the label and icon live.
labelRes Int: Resource containing the label, or 0 if none.
icon Int: Resource containing the icon, or 0 if none.

LabeledIntent

Added in API level 5
LabeledIntent(
    sourcePackage: String!,
    nonLocalizedLabel: CharSequence!,
    icon: Int)

Create a labeled intent with no intent data but supplying a textual label and icon resource for it.

Parameters
sourcePackage String!: The package in which the label and icon live.
nonLocalizedLabel CharSequence!: Concrete text to use for the label.
icon Int: Resource containing the icon, or 0 if none.

Public methods

getIconResource

Added in API level 5
open fun getIconResource(): Int

Return any resource identifier that has been given for the label icon.

getLabelResource

Added in API level 5
open fun getLabelResource(): Int

Return any resource identifier that has been given for the label text.

getNonLocalizedLabel

Added in API level 5
open fun getNonLocalizedLabel(): CharSequence!

Return any concrete text that has been given for the label text.

getSourcePackage

Added in API level 5
open fun getSourcePackage(): String!

Return the name of the package holding label and icon resources.

loadIcon

Added in API level 5
open fun loadIcon(pm: PackageManager!): Drawable!

Retrieve the icon associated with this object. If the object does not have a icon, null will be returned, in which case you will probably want to load the icon from the underlying resolved info for the Intent.

loadLabel

Added in API level 5
open fun loadLabel(pm: PackageManager!): CharSequence!

Retrieve the label associated with this object. If the object does not have a label, null will be returned, in which case you will probably want to load the label from the underlying resolved info for the Intent.

readFromParcel

Added in API level 5
open fun readFromParcel(in: Parcel!): Unit

writeToParcel

Added in API level 5
open fun writeToParcel(
    dest: Parcel,
    parcelableFlags: Int
): Unit
Parameters
dest Parcel: The Parcel in which the object should be written. This value cannot be null.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 5
static val CREATOR: Parcelable.Creator<LabeledIntent!>