alpha
alpha

Reputation: 1298

What's the meaning of the parameter code in PendingIntent.send()?

I have read the PendingIntent document:

http://developer.android.com/reference/android/app/PendingIntent.html

The function send is defined as:

public void send(Context context, int code, Intent intent, OnFinished onFinished, Handler handler, String requiredPermission)

code: "Result code to supply back to the PendingIntent's target."

What make me confused is the parameter code. When I should use it and how can I get it from the PendingIntent send target (activity/service/receiver) ?

Upvotes: 2

Views: 345

Answers (1)

pturner
pturner

Reputation: 686

This would be the result code associated with BroadCastReceivers

See: getResultCode()

Can also get the final result code with a OnFinished listener that is sent using the version of send you referenced.

Upvotes: 1

Related Questions