I’m having a hard time figuring out why my App Widget ListView won’t populate with data. Everything seems to be wired up right. When I debug, I can see the data that is being retrieved from my database (Firestore). However, it still won’t populate into the App Widget.
I created a new Issue on my Github to make it easier to view the problem:Github Issue
RemoteViewsFactory
- The data is successfully retrieved from
Firestore DB List<Review> reviewsis populated- The
Reviewobjects within it contain the right data get()methods return the right data
ReviewsAppWidgetProvider
ReviewsWidgetService Intentis createdsetRemoteAdapter()is called using theIntentand passing in theListViewas wellupdateAppWidget()is callednotifyAppWIdgetViewDataChaged()is called
ReviewFragment
ReviewsAppWidgetProvider.updateAppWidgets()is called when adding or deleting reviews
AndroidManifest
ReviewsAppWidgetProviderdeclared as a reveiver- Intent Filter set for
action.APPWIDGET_UPDATE ReviewsWidgetServicedeclared as Service- permssion
BIND_REMOTEVIEWSset
As you said, everything is ok with fetching data. But it's still draw a loading view. So the problem is in your divider. View can't be used in app widgets, because launcher process doesn't know about view, it's only know about limited count of views, all views that can be used, you can find here.
So how to make a such divider? Firstly you need a shape, so it will be something like bottom_border.xml:
So now in your root view add background bottom_border.xml like: