开发者

Service, Broadcast Receiver Instead of startActivityForResult?

开发者 https://www.devze.com 2023-03-19 07:43 出处:网络
I\'m developing a service and I\'ve been following an example that开发者_StackOverflow中文版 unfortunately uses an Activity to get its work done.The example uses startActivityForResult() to get values

I'm developing a service and I've been following an example that开发者_StackOverflow中文版 unfortunately uses an Activity to get its work done. The example uses startActivityForResult() to get values after doing something. I'm wondering do I just use BroadcastReceiver to accomplish the same thing? sendBroadcast(intent) and then capture the broadcast to do whatever?


Yes, for me is the best solution, but you can bind the service to the activity if you want another solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消