AppWidgetProvider: not called onEnabled method

前端 未结 2 466
一整个雨季
一整个雨季 2021-01-16 15:59

I have widget that display data from content provider. I want to know when data in content provider changes. As far as I know way to do it is

context.getConte

2条回答
  •  感情败类
    2021-01-16 16:26

    An AppWidgetProvider (or any other manifest-registered BroadcastReceiver) cannot call registerContentObserver(). The entity that is changing your content will need to update your app widget, or you will need to implement some sort of polling mechanism (e.g., check for new content based on android:updatePeriodMillis).

提交回复
热议问题