Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Mobile Development > BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 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 December 30th, 2008, 03:36 PM
Registered User
 
Join Date: Dec 2008
Location: Alameda, CA USA
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 2 -- To Do List -- when to use super.onCreate(icicle);?

Eclipse sets up a new Android project with onCreate and includes super.onCreate(savedInstance) as the first line. I see this in the sample code I downloaded, but don't see it on page 40 of the book.

Without this line, the debugger throws a "source not found" error.

My question is, Where is onCreate that we are overriding? and why do we need to do this (was this supposed to be included in page 40)?

thanks.
Reply With Quote
  #2 (permalink)  
Old December 30th, 2008, 07:37 PM
Registered User
 
Join Date: Dec 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm getting the same error. What is the problem?
Reply With Quote
  #3 (permalink)  
Old December 31st, 2008, 03:37 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

Quote:
Originally Posted by SteveOliverC View Post
My question is, Where is onCreate that we are overriding? and why do we need to do this (was this supposed to be included in page 40)?
Apologies! Yes, it looks like the super.onCreate(icicle) line somehow got dropped from the text on page 40 -- you always need to call super.OnCreate when overriding the onCreate method of an Activity. It should be the first thing called in the overriding method.

The correct technique for overriding onCreate is shown on page 66, or as you point out, in the downloadable code samples.

Sorry again for the confusion, not sure how that snuck through.
__________________
Reto Meier

Author, "Professional Android 4 Application Development", Wrox, ©2012, 2010, 2008
@retomeier
Reply With Quote
The Following User Says Thank You to Reto For This Useful Post:
SteveOliverC (December 31st, 2008)
  #4 (permalink)  
Old December 31st, 2008, 11:27 AM
Registered User
 
Join Date: Dec 2008
Location: Alameda, CA USA
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

No worries! and thanks for the quick reply and clarification. I'm really enjoying the book and I am very impressed with the quality (especially considering how quickly the book came to market).
Reply With Quote
  #5 (permalink)  
Old December 31st, 2008, 11:58 AM
Registered User
 
Join Date: Dec 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just one more question about icicle. What is icicle and why do I change savedInstance to icicle?

I also agree this book is fantastic. Thank you.
Reply With Quote
  #6 (permalink)  
Old January 1st, 2009, 01:49 PM
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

'icicle' is what earlier versions of the SDK used to name the Bundle objects that got passed in to the onCreate method. The new SDK defaults the name to savedInstanceState. I've used them interchangeably, but for consistency it's probably easiest to stick with savedInstanceStatein your own projects.

It's great to hear you guys are finding the book useful, thanks for the kind words.
__________________
Reto Meier

Author, "Professional Android 4 Application Development", Wrox, ©2012, 2010, 2008
@retomeier
Reply With Quote
  #7 (permalink)  
Old January 5th, 2009, 10:42 PM
Registered User
 
Join Date: Jan 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Worked for me...

The eclipse plugin automatically inserted that line for me and I guess I didn't even notice since I had already seen it in other examples. I was wondering about the random use of the term icicle however so thanks for the clarification.
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
'super' keyword ?! nerssi Javascript 0 February 14th, 2008 08:17 AM
Invoke Events that were declated in a super class Aaron Edwards ASP.NET 2.0 Professional 1 January 2nd, 2008 03:59 PM
Chapter 7 - List Views Not Refreshing VBNovice BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 3 January 31st, 2007 08:26 PM



All times are GMT -4. The time now is 11:46 PM.


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