问题
I have a widget from my app that initially makes a POST request and gets some info in an array and displays them on the widget. It has two buttons for going next and previous on this information and it works perfectly when i build the App.
Problem is the moment i close the app the widget stops working, the buttons do nothing.
I have no idea what to do.
As long as i keep my app opened the app works perfectly but i want it to work even when the app is closed. How can I do that ?
回答1:
You could use a Service running in background that communicates with the AppWidgetProvider. See this example: Widget-Service communication
来源:https://stackoverflow.com/questions/25509025/widget-stops-working-atfter-i-close-my-app