Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2
This is the forum to discuss the Wrox book Professional Android Application Development by Reto Meier; ISBN: 9780470344712
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 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
  #1 (permalink)  
Old March 4th, 2009, 11:45 AM
Registered User
 
Join Date: Feb 2009
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default Code not going as planned: "icicle" vs "savedinstancestate"

Hello:

I am new to the eclipse platform, and I haven't programmed in quite some time (have some experience in Visual Basic and C). Not sure if this problem is related to the dev-environment or specific Java SDK I'm using.

But in Chapter 2, the Hello World program, I have followed all prior steps in the book, except that the code that the JDT automatically fills in has the lines:

----public void onCreate(Bundle savedInstanceState) et. al----

whereas the book describes that the same line should have been:

----public void onCreate(Bundle icicle) et. al----

Why is this? Where does this discrepancy arise from and has no one else experienced this? It's a minor discrepancy, but I am wondering if this is only the beginning of a slough of problems I may eventually have to overcome.

I am using
Eclipse Ganymede 3.4.2 build M20090211-1700
Android SDK 1.1 r1
JDK 6 u12

There is another issue which I will post in another thread.
  #2 (permalink)  
Old March 4th, 2009, 11:53 AM
Reto's Avatar
Wrox Author
Points: 287, Level: 5
Points: 287, Level: 5 Points: 287, Level: 5 Points: 287, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2008
Location: London, United Kingdom
Posts: 61
Thanks: 1
Thanked 7 Times in 6 Posts
Default

What you're seeing shouldn't cause any problems, it's a hold-over from an earlier release of the SDK which defaulted the parameter name in the onCreate method to 'icicle' rather then 'savedInstanceState'.

Given that what's changed is just the parameter name (rather than the class -- Bundle -- being passed in) you can use either name, as long as you use it consistently if you access it within that method.

Hopefully that's one of the few inconsistencies you'll find, but if you do spot any other problems I'll be more than happy to try and help solve them.
__________________
Reto Meier

Author, "Professional Android 4 Application Development", Wrox, ©2012, 2010, 2008
@retomeier
The Following User Says Thank You to Reto For This Useful Post:
joopthecat (March 5th, 2009)
  #3 (permalink)  
Old March 5th, 2009, 11:49 AM
Registered User
 
Join Date: Feb 2009
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thank you very much, Mr. Meier, for this and your reply to my other posted question. As far as this particular subject is concerned, I suppose I would need to keep abreast of all future changes, minor or not, so as to avoid confusion.
  #4 (permalink)  
Old May 3rd, 2009, 03:09 PM
Registered User
 
Join Date: May 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ha! I was confused about that, too. (savedInstanceState, of course, being far more intuitive than the wintry wonderland Christmas spirit of icicle.)

Maybe not really an errata as the other code will work, but worth an official note?

Were there other terminology changes in the lifecycle stuff of which we should be aware?


Similar Threads
Thread Thread Starter Forum Replies Last Post
Downloaded code: "20-4" missing Rachel BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 1 February 16th, 2009 06:00 PM
how to read xml files doing select="document()" ? eruditionist XSLT 2 February 10th, 2009 05:08 PM
Message received by "FILE" adapter is suspended skindika Biztalk 0 February 2nd, 2009 07:06 PM
WebPart not supporting/enabled displaymode other than "Browse" amitjoshipune ASP.NET 2.0 Professional 1 January 9th, 2009 02:34 PM
google Response.Write(Request.QueryString("q")) senol01 ASP.NET 2.0 Basics 1 January 2nd, 2009 12:01 PM





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