Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
そのアクティビティを開始したサービスのアクティビティの結果を取得するにはどうすればよいですか?
例:サービスS->開始->アクティビティA。ここで、たとえばブール結果をサービスに送り返したいと思います。それは可能ですか?
よろしく、
ロバート
再度呼び出しstartService()て、boolean の結果をIntentエクストラとしてパッケージ化し、サービスが取得しonStartCommand()ます。
startService()
Intent
onStartCommand()
サービスにアクティビティを開始させることは珍しいことであり、特に何か他のことをしている最中の場合は、ユーザーが望んでいない可能性があることに注意してください。