The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

gyleiverson (3) [Avatar] Offline
#1
I built and deployed SiteMonitor to a 2.2 emulator, then dragged the widget to the home screen.

I expected the configuration activity to start but it did not. The widget just shows as the default android icon. When the widget icon is clicked, the configuration activity appears. Filling in the fields with data and saving. When back to the home screen, the widget still appears as the default android icon.

Can you imagine what I have missed?

Thanks in advance,
Gyle

P.S. Love the book.
frank.ableson (75) [Avatar] Offline
#2
Re: Chapter 17 - SiteMonitor widget display issue
Hello Gyle,

This project is particularly challenging to debug as there are lots of moving pieces!

I would start by connecting up to DDMS and watching for the activity in the logcat.

If you click back on the icon to edit the config, are your settings retained?

Frank
gyleiverson (3) [Avatar] Offline
#3
Re: Chapter 17 - SiteMonitor widget display issue
Hello, Frank.

I have been relying on Eclipse to show me the logcat. I guess the part that has me baffled is... I never see any messages in the logcat that appear to describe inflating the widget. Should I see such? Is that something taken care of by the AppWidget manager or something that the app widget takes care of itself?

Yes. When I click on the icon, change the configuration, save the changes, and click on the icon again, my configuration is retained.

Thanks for your help.

Best regards,
Gyle
gyleiverson (3) [Avatar] Offline
#4
Re: Chapter 17 - SiteMonitor widget display issue
Hello, Frank.

Here is another clue.

In SiteMonitorWidgetImpl::onReceive(), the int array returned by appWidgetManager.getAppWidgetIds() is empty.

Best regards,
Gyle