Wrox Programmer Forums
|
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
 
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.
 
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.
 
Old January 22nd, 2011, 08:13 AM
Authorized User
 
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());
 
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





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





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