• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps does PendingIntent.getBroadcast return the same object instance?

liortal

Lurker
I have some piece of code that generates a PendingIntent object with a certain Intent in it.

The Intent's action is based on some user supplied string.

I'd like to unit test this method, and to assert certain i'm getting the SAME PendingIntent object in case the same string is used:

var a = createPendingIntent("someName");

var b = createPendingIntent("someName");

// this fails...
assert(a == b);

I am wondering whether the call PendingIntent.getBroadcast() returns a reference to the SAME OBJECT in case the Intent that is passed to it matches?
 
Back
Top Bottom