android widget and localservice bind
I writing player, it has main activity that runs localservice. I can't find how开发者_如何学C bind localservice to widget. When i trying to bind it like in activity it fails.
Plz help me.
Adding #1 How can I contact with background service when? http://www.developer.com/ws/data/article.php/10944_3843561_1/Handling-Lengthy-Operations-with-Android-App-Widgets.htm
here i found something, but it doen't work for me.
You cannot bind to a service from an AppWidgetProvider
.
You can bind to a service from a AppWidgetProvider like so:
context.getApplicationContext().bindService(intent, ServiceConnection, Flags);
The context is the parameter on the onUpdate method.
精彩评论