Android widget update after x time

前端 未结 2 820
悲哀的现实
悲哀的现实 2021-01-15 04:12

I just started to learn Android, I\'m trying to write a widget which is updating the counter in every seconds, but somewhere it\'s missing something.I\'m getting 1 on the sc

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-15 04:39

    after

    appWidgetManager.updateAppWidget(appWidgetId, views);
    

    add this

    super.onUpdate(context, appWidgetManager, appWidgetId);
    

    i believe this will solve your problem

提交回复
热议问题