You are currently viewing the BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
Chap6 - Earthquake not updating when nothing matches preferences
I noticed that if I select a minimum magnitude that does not return any quakes, the list of quakes displayed is not updated.
The arrayList earthquakes is cleared in refreshEarthquakes(), but the ArrayAdapter aa.notifyDataSetChanged is not being called in addNewQuake() since the condition regarding minmum magnitude does not satisfy.
I got around the problem by shifting the aa.notifyDataSetChanged() to the end of refreshEarthquakes() instead. That way the ArrayAdapter gets notified everytime there is a "refresh".