5

My app uses Firebase database and items are displayed correctly in a RecyclerView, but I want to display them also in a Widget. Since a widget is not an activity I run into all sort of problems using Firebase and ListView. Is there any way to populate a Widget from Firebase?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Pedro Gonzalez
  • 1,429
  • 2
  • 19
  • 30

1 Answers1

0

Taking more than 20 seconds in onDataSetChanged() to fetch data from internet/Firebase Database will not display data on widget listview. You will have to use CountDownLatch.

Also, here is an example https://github.com/mvescovo/item-reaper

https://github.com/mvescovo/item-reaper/blob/master/app/src/main/java/com/michaelvescovo/android/itemreaper/widget/WidgetListService.java