Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| 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 January 22nd, 2011, 05:40 AM
Registered User
 
Join Date: Jan 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Chapter 2 - ToDoList Example

Hi,

I am new to android development. I started learning android from this book. From the 2nd chapter of this book, i started coding To-Do List example in eclipse. When I completed the 6th step of the To-Do List Example, I am getting following errrors in eclipse.

ListView cannot be resolved to a type
EditText cannot be resolved to a type
R.id cannot be resolved


Please help me to resolve these errors and move forward with this example.
Reply With Quote
  #2 (permalink)  
Old January 22nd, 2011, 07:21 AM
Registered User
 
Join Date: Jan 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 2 - ToDoList Example

I am able to resolve the above errors. Eclipse is so intelligent that it advised me to import the corresponding package to resolve it. However I am getting a new error in step 8 of this example. The add method used is not getting compiled successfully.

The line of code with error is

Code:
todoItems.add(0, myEditText.getText(),toString());
The error is

The method add(int, String) in the type ArrayList<String> is not applicable for the arguments (int,Editable,String)

Please help me to resolve this error.
Reply With Quote
  #3 (permalink)  
Old January 22nd, 2011, 08:13 AM
Authorized User
Points: 62, Level: 1
Points: 62, Level: 1 Points: 62, Level: 1 Points: 62, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2010
Posts: 12
Thanks: 0
Thanked 3 Times in 2 Posts
Default Syntax error fix

It's quite a simple fix, you have a comma where you should have a period just before the toString(). The code should be:

Code:
todoItems.add(0, myEditText.getText().toString());
Reply With Quote
  #4 (permalink)  
Old January 22nd, 2011, 01:09 PM
Registered User
 
Join Date: Jan 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Syntax error fix

Thanks aajshaw for resolving this..

This code being my first handson on android, your resolution to this query helped me to move ahead
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 4 ToDoList Problem cythe BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 6 June 15th, 2011 09:53 PM
Chapter 2 or 4 ToDoList. How to have lists to show up in ListView ? Ahmad Mobasseri BOOK: Professional Android 2 Application Development 3 August 23rd, 2010 03:21 PM
chapter 2 todolist kdpohl1 BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 5 July 16th, 2010 03:59 AM
Chapter 4 ToDoList runs but no custom view? scottm BOOK: Professional Android 2 Application Development 8 June 21st, 2010 01:04 PM
Chapter 6 Todolist & SQLITE3 JHandal BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 1 April 28th, 2010 12:57 PM



All times are GMT -4. The time now is 02:49 AM.


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