As Alex indicated, you can bind to the service and pass some sort of listener or callback to the service to use on events.
Or, you can use a broadcast Intent
, perhaps using methods like setPackage()
on the Intent
to limit the scope of the broadcast.
Or, you can use createPendingResult()
to create a PendingIntent
that you pass as an Intent
extra to the service -- the service can then use that PendingIntent
to trigger onActivityResult()
in your activity.
Or, you can use a ResultReceiver
.
Or, you can use a Messenger
.
(admittedly, I have not tried those latter two approaches, but I think they will work here)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…