English | Site Directory

Android - An Open Handset Alliance Project

android.app
public final class

android.app.ActivityPendingResult

java.lang.Object
android.app.ActivityPendingResult Parcelable

This object provides a token for an existing activity, which can be used to send results back to that activity, whether or not that activity is currently running. Instances are created with createActivityPendingResult(int, boolean).

Summary

Constants

      Value  
Creator  CREATOR       

Public Methods

        ComponentName  getTargetActivityClass()
Return the class name of the activity that will be receiving this result.
        String  getTargetPackage()
Return the package name of the activity that will be receiving this result.
        boolean  sendResult(int code, String data, Bundle ex)
Send a result back to the originating activity.
        void  writeToParcel(Parcel out)
Methods inherited from class java.lang.Object
Methods inherited from interface android.os.Parcelable

Details

Constants

public static final Creator CREATOR

Public Methods

public ComponentName getTargetActivityClass()

Return the class name of the activity that will be receiving this result. The returned string is supplied by the system, so that an activity can not spoof its name.

Returns

  • The class name of the target activity, or null if the activity result is no longer valid.

public String getTargetPackage()

Return the package name of the activity that will be receiving this result. The returned string is supplied by the system, so that an activity can not spoof its package.

Returns

  • The package name of the target activity, or null if the activity result is no longer valid.

public boolean sendResult(int code, String data, Bundle ex)

Send a result back to the originating activity. See onActivityResult(int, int, String, Bundle) for more information on activity results.

Parameters

code Standard result code.
data Data associated with the result.
ex Any additional data.

Returns

  • Returns true if the result was successfully sent, else false. A false may be returned, for example, if this is a one-shot result that has already been used or the target activity has finished.

public void writeToParcel(Parcel out)

Build m5-rc15g - 14 May 2008 12:50