Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Mobile Development > BOOK: Professional Android 4 Application Development
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Android 4 Application Development
This is the forum to discuss the Wrox book Professional Android 4 Application Development Reto Meier; ISBN: 978-1-1181-0227-5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android 4 Application Development section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 6th, 2013, 09:14 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 7 part 1 - aa.notifyDataSetChanged() omitted ?

Shouldn't notifyDataSetChanged() be inside the `if' ?

Code:
private void addNewQuake(Quake _quake) {
    Earthquake earthquakeActivity = (Earthquake)getActivity();
    if (_quake.getMagnitude() > earthquakeActivity.minimumMagnitude) {
      // Add the new quake to our list of earthquakes.
      earthquakes.add(_quake);
    }

    // Notify the array adapter of a change.
    aa.notifyDataSetChanged();
  }
As you can see here, aa.notiftyDataSetChanged() is called every time the addNewQuake is called, independently if the quake is added or not. Is that OK ?


Also, in refreshEarthquakes, the list is cleared without notifying the adapter:

Code:
        // Clear the old earthquakes
        earthquakes.clear();
This seems an error to me, isn't it ?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 9 Earthquake Part 3 majeedk BOOK: Professional Android 4 Application Development 0 December 1st, 2012 07:30 AM
Earthquake chapter 7 part 2 layingincouch BOOK: Professional Android 4 Application Development 1 October 31st, 2012 05:54 PM
chapter-4, Web Part mns BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 0 October 16th, 2009 03:56 PM
Converting string "aA" to a BigInteger kedklok Java Basics 1 March 4th, 2006 02:33 AM
last occurance omitted - LOOP error? crmpicco Excel VBA 3 May 5th, 2005 01:45 PM



All times are GMT -4. The time now is 07:32 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.