|
|
 |
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 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.
|
 |

March 4th, 2009, 11:45 AM
|
|
Registered User
|
|
Join Date: Feb 2009
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
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.
|

March 4th, 2009, 11:53 AM
|
 |
Wrox Author
|
|
Join Date: Oct 2008
Location: London, United Kingdom
Posts: 22
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
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.
|
|
The Following User Says Thank You to Reto For This Useful Post:
|
|

March 5th, 2009, 11:49 AM
|
|
Registered User
|
|
Join Date: Feb 2009
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
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.
|

May 3rd, 2009, 04:09 PM
|
|
Registered User
|
|
Join Date: May 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |