문제

I have an appwidget and i want to set an onClick Pending Intent. I would like this PendingIntent to be set from the UpdateService class, not the WidgetProvider class. I've unsuccessfully tried to do it in the same way as i would from the WidgetProvider class.

Edit 2: The issue that caused me to post this question turned out to be unrelated. But having confirmation that it is possible to do it, i kept trying and found that my problem was caused by the onClick appwidget layout item being obscured by higher layers in the appwidget layout.
(edit 1 removed code as it was irrelevant.)

도움이 되었습니까?

해결책

Step #1: Have UpdateService obtain an instance of AppWidgetManager, via the static getInstance() method.

Step #2: Call updateAppWidget() on the AppWidgetManager.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top