Wrox Programmer Forums
BOOK: Professional Android 2 Application Development
This is the forum to discuss the Wrox book Professional Android 2 Application Development, 2nd Edition by Reto Meier; ISBN: 978-0-470-56552-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android 2 Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 17th, 2012, 10:28 AM
Registered User
Join Date: Jun 2012
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Earthquake Preferences

I've been going through the exercises in this book and for the most part I've had few problems. The earthquake example has been interesting but now it is confounding me. At some point in the book (chapter 6) we added preference options to the application and they worked fine. Then this was put to one side as through the next few chapters we worked on adding other functionality. By chapter 9 we start moving various things into the service class and from here on selecting the preference option causes the application to crash and a 'force close' message to be displayed.

There are a couple of lines of code that have dissapeared in the downloadable source code, despite not being told to in the book. For example the line

SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getA pplicationContext());
prefs.registerOnSharedPreferenceChangeListener(thi s);

in the onCreate method of the Earthquake class has vanished. Is this intentional? Also the variable 'minimumMagnitude' in the EarthquakeService class doesn't seem to do anything.

I understand that the author wasn't focusing on the preferences in these later chapters, but it is a pity he didn't test to make sure the preferences feature still worked throughout the later examples.

Has anyone else come across this? What do I need to do to make the preferences work again?


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 6, Earthquake 2 [preferences not working] nyyrikki BOOK: Professional Android 2 Application Development 8 January 7th, 2013 10:59 AM
Chapter 7 Earthquake 2, Earthquake.java, error onActivityResult dbomberg BOOK: Professional Android 2 Application Development 2 November 30th, 2012 05:52 AM
saving preferences droidus BOOK: Beginning Android Application Development 0 April 21st, 2012 09:26 PM
Chap6 - Earthquake not updating when nothing matches preferences cartoon BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 1 January 16th, 2010 05:41 AM
VBScript and printer preferences CmdrDuh VB How-To 0 November 9th, 2007 03:07 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.