I have an activity that has 2 button(start, end), when the user presses start, the activity will fire a service that record the voice and save it when the user presses end button. And to make sure that the user know he is recording, I add a textview on the activity UI and hope that the service class can change it to something like “it is recording…” on the service’s onStartCommand() and “Finished record” on the onDestory() . But since Service class doesn’t support findviewbyId(), how do I solve this problem???
Share
The easiest way to accomplish that would be to use a Toast notification, which can be created and displayed from a service- here’s the documentation on Toasts: http://developer.android.com/guide/topics/ui/notifiers/toasts.html
According to that page, this example demonstrates everything you need for most toast notifications. You should rarely need anything else: