What I would like to do is get the value of variable stored in the main Application when the widget is first installed. Every time the variable is updated the main application sends it to the widget using sendBroadcast(intent); However, this means the first time the widget is installed it displays nothing.
Can you send a request to the application for data?
An
AppWidgetProvideris part of your application. It has access to all your databases, files, preferences, or other data stores. Simply use that data when you create your app widget inonUpdate().That is silly. The main application can use
AppWidgetManagerto update the app widget directly.