plorent (24) [Avatar] Offline
#1
I'm finishing chapter 2 where we build the DealDroid and have installed the app on my device. When using the app, the menu-option 're-parse feed' to me results in unexpected behavior and a bug. If I'm in another deal list it gets me the 'default' Daily List, but the spinner is not updated. When tapping an item in the list, the wrong item appears in the DealDetails. It gives you the details for a deal that was in that position in the 'previous' list - before re-parsing the feed.
Although the concepts in the chapter are very clearly written - thanks for that - shouldn't this bug be fixed, or used as a debug example?
charlie.collins (125) [Avatar] Offline
#2
Re: DealDroid - re-parse feed
Absolutely it should be fixed. I didn't know it was that buggy, but I'll look at it ASAP and try to get an update out.

Truth be told the "re-parse feed" was bolted on to the example afterwards. The main code was written as part of the "DealDroidWithService" example, then it was simplified and the service part removed (because that is a more advanced topic for a later chapter). Then, after the rest, the "re-parse" functionality was added.

Regardless, yeah, it should work as expected. I'll look at it as soon as I can and get it fixed.

Thanks for letting us know about the issue.
charlie.collins (125) [Avatar] Offline
#3
Re: DealDroid - re-parse feed
It's fixed in the source now.

Basically the problem was that when the feed was reparsed I was resetting the "items" on the page, but not the spinner/selection. When you reparse it now correctly resets both and takes you back to the "Daily Deals" list of items, and resets the Spinner.

BTW, if you want to really use DealDroid on a device (I do, sometimes it's handy), the DealDroidWithService will automatically re-parse the feed and show you a notification (only when there are new deals). It does this with a background IntentService (and it doesn't leave it the service running either, it uses AlarmManager to run the service at intervals with inexact repeating only when the phone is awake, and it checks for deals, and then kills the service).
charlie.collins (125) [Avatar] Offline
#4
Re: DealDroid - re-parse feed
plorent (24) [Avatar] Offline
#5
Re: DealDroid - re-parse feed
Thanks Charlie! I've seen the DealDroidWithService (worked my way through the other available chapters). And just got an update with new chapters! Perfect timing! Thank you very much.