i was searching on google for possibilities to callback a client from a remote service.
there where three major approaches:
- client offers AIDL the same way as the service does (bound)
- client listens with a broadcast receiver(onStartCommand)
- use of: client->createPendingResult(), service->send(), client evaluates onActivityResult()(onStartCommand)
i have not found this one:
client activity is launched with “singleTop” in the manifest.
service uses context.startActivity(intent) with the answer within the intent.
client evaluates onNewIntent(intent,..). (onStartCommand)
Are there any potential problems with this approach?
Try the following tutorial: