IT. Expert System.

Android Reference

IntentSender


android.content

Class IntentSender

  • All Implemented Interfaces:
    Parcelable


    public class IntentSender
    extends Object
    implements Parcelable
    A description of an Intent and target action to perform with it. The returned object can be handed to other applications so that they can perform the action you described on your behalf at a later time.

    By giving a IntentSender to another application, you are granting it the right to perform the operation you have specified as if the other application was yourself (with the same permissions and identity). As such, you should be careful about how you build the IntentSender: often, for example, the base Intent you supply will have the component name explicitly set to one of your own components, to ensure it is ultimately sent there and nowhere else.

    A IntentSender itself is simply a reference to a token maintained by the system describing the original data used to retrieve it. This means that, even if its owning application's process is killed, the IntentSender itself will remain usable from other processes that have been given it. If the creating application later re-retrieves the same kind of IntentSender (same operation, same Intent action, data, categories, and components, and same flags), it will receive a IntentSender representing the same token if that is still valid.

    Instances of this class can not be made directly, but rather must be created from an existing PendingIntent with PendingIntent.getIntentSender().

    • Constructor Detail

      • IntentSender

        public IntentSender(IIntentSender target)
    • Method Detail

      • sendIntent

        public void sendIntent(Context context,
                      int code,
                      Intent intent,
                      IntentSender.OnFinished onFinished,
                      Handler handler)
                        throws IntentSender.SendIntentException
        Perform the operation associated with this IntentSender, allowing the caller to specify information about the Intent to use and be notified when the send has completed.
        Parameters:
        context - The Context of the caller. This may be null if intent is also null.
        code - Result code to supply back to the IntentSender's target.
        intent - Additional Intent data. See Intent.fillIn() for information on how this is applied to the original Intent. Use null to not modify the original Intent.
        onFinished - The object to call back on when the send has completed, or null for no callback.
        handler - Handler identifying the thread on which the callback should happen. If null, the callback will happen from the thread pool of the process.
        Throws:
        IntentSender.SendIntentException - Throws CanceledIntentException if the IntentSender is no longer allowing more intents to be sent through it.
      • sendIntent

        public void sendIntent(Context context,
                      int code,
                      Intent intent,
                      IntentSender.OnFinished onFinished,
                      Handler handler,
                      String requiredPermission)
                        throws IntentSender.SendIntentException
        Perform the operation associated with this IntentSender, allowing the caller to specify information about the Intent to use and be notified when the send has completed.
        Parameters:
        context - The Context of the caller. This may be null if intent is also null.
        code - Result code to supply back to the IntentSender's target.
        intent - Additional Intent data. See Intent.fillIn() for information on how this is applied to the original Intent. Use null to not modify the original Intent.
        onFinished - The object to call back on when the send has completed, or null for no callback.
        handler - Handler identifying the thread on which the callback should happen. If null, the callback will happen from the thread pool of the process.
        requiredPermission - Name of permission that a recipient of the PendingIntent is required to hold. This is only valid for broadcast intents, and corresponds to the permission argument in Context.sendOrderedBroadcast(Intent, String). If null, no permission is required.
        Throws:
        IntentSender.SendIntentException - Throws CanceledIntentException if the IntentSender is no longer allowing more intents to be sent through it.
      • getCreatorPackage

        public String getCreatorPackage()
        Return the package name of the application that created this IntentSender, that is the identity under which you will actually be sending the Intent. The returned string is supplied by the system, so that an application can not spoof its package.
        Returns:
        The package name of the PendingIntent, or null if there is none associated with it.
      • getCreatorUid

        public int getCreatorUid()
        Return the uid of the application that created this PendingIntent, that is the identity under which you will actually be sending the Intent. The returned integer is supplied by the system, so that an application can not spoof its uid.
        Returns:
        The uid of the PendingIntent, or -1 if there is none associated with it.
      • getCreatorUserHandle

        public UserHandle getCreatorUserHandle()
        Return the user handle of the application that created this PendingIntent, that is the user under which you will actually be sending the Intent. The returned UserHandle is supplied by the system, so that an application can not spoof its user. See Process.myUserHandle() for more explanation of user handles.
        Returns:
        The user handle of the PendingIntent, or null if there is none associated with it.
      • equals

        public boolean equals(Object otherObj)
        Comparison operator on two IntentSender objects, such that true is returned then they both represent the same operation from the same package.
        Overrides:
        equals in class Object
        Parameters:
        otherObj - the object to compare this instance with.
        Returns:
        true if the specified object is equal to this Object; false otherwise.
        See Also:
        Object.hashCode()
      • hashCode

        public int hashCode()
        Description copied from class: Object
        Returns an integer hash code for this object. By contract, any two objects for which Object.equals(java.lang.Object) returns true must return the same hash code value. This means that subclasses of Object usually override both methods or neither method.

        Note that hash values must not change over time unless information used in equals comparisons also changes.

        See Writing a correct hashCode method if you intend implementing your own hashCode method.

        Overrides:
        hashCode in class Object
        Returns:
        this object's hash code.
        See Also:
        Object.equals(java.lang.Object)
      • toString

        public String toString()
        Description copied from class: Object
        Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
           getClass().getName() + '@' + Integer.toHexString(hashCode())

        See Writing a useful toString method if you intend implementing your own toString method.

        Overrides:
        toString in class Object
        Returns:
        a printable representation of this object.
      • describeContents

        public int describeContents()
        Description copied from interface: Parcelable
        Describe the kinds of special objects contained in this Parcelable's marshalled representation.
        Specified by:
        describeContents in interface Parcelable
        Returns:
        a bitmask indicating the set of special object types marshalled by the Parcelable.
      • writeIntentSenderOrNullToParcel

        public static void writeIntentSenderOrNullToParcel(IntentSender sender,
                                           Parcel out)
        Convenience function for writing either a IntentSender or null pointer to a Parcel. You must use this with readIntentSenderOrNullFromParcel(android.os.Parcel) for later reading it.
        Parameters:
        sender - The IntentSender to write, or null.
        out - Where to write the IntentSender.
      • getTarget

        public IIntentSender getTarget()


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: 403 / . Delta: 0.01689 с