Calling service method to widget
Hi I have a android widget, that show info from one service application that I have. I update the info from the service and this is running good. But I have a problem. My service works in second plane when the application is close, if I create the widget when the app is second plane the service is running and how my servic开发者_开发技巧e is running when my widget try to start the services dont make (This is good) but this makes it that my service dont update the widget. I try to bind the service to the widget for call to method that refresh my widget, but I cant because I recive an error.
How can I call to service from my widget without a button? I need make another service inside the widget that call the other service? Can have any way to send a message to the service?
Thanks,
For resolve it, I've create other service, this is called by the app widget when start it, and destroyed when the widget is destroyed it. this service when start bind with my base service and call to method. It's working but I dont know if it is the best solution.
精彩评论