Wrox Programmer Forums
|
BOOK: Professional Android 2 Application Development
This is the forum to discuss the Wrox book Professional Android 2 Application Development, 2nd Edition by Reto Meier; ISBN: 978-0-470-56552-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android 2 Application Development 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 November 19th, 2011, 07:16 PM
Registered User
 
Join Date: Nov 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Angry Chapter2 - To Do List error

I am getting the error "myListView cannot be resolved or is not a field." in the chapter 2 exercise. I notice that several other people are having the same problem. I have downloaded the code zip file but that did not seem to help. I noticed that the R.java did not put the "myListView" in the id section where "myEditText" is located. I am also getting a green triangle at the "onCreate(Bundle saveInstanceState)" which shows the Class File Editor error - Source not found for the Activity.java file. I am running Eclipse Helios with JDK 6.27 and JRE 6.29. Am I missing a path or what? This is very frustrating for me.
 
Old November 21st, 2011, 01:16 PM
Registered User
 
Join Date: Nov 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation I found a fix and caused another error

[edit] I was using Eclipse Indigo.

Here is the fix:
Code:
  <ListView android:id="@+id/myListView">
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
    </ListView>
note that the "android:id="@+id/myListView" has to be in the ListView opening tag not like EditView.

Here is the new error:
!Sorry The application ToDoList (process com.paad.todolist) has stopped unexpectedly. Please try again. <Force close>

oh well always something.
 
Old November 21st, 2011, 01:31 PM
Registered User
 
Join Date: Nov 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Smile I found the solution to the second error

same code block in the xml. Here is the fix so far that works.
Code:
    
<ListView android:id="@+id/myListView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">
    </ListView>
The actual error was that I was missing an attribute for android:layout. When I moved everything into the opening tag, the error was fixed.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter2 : To Do List example albiert BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 2 June 1st, 2010 01:28 PM
Chapter2 error BlackSoul BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 1 January 4th, 2010 04:27 PM
Chapter2: Compilation Error. krytonx85 BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 2 June 18th, 2009 08:14 PM
Chapter2 netblue BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 2 June 5th, 2007 01:19 AM
Compiled error of executing chapter2 source code williamlin BOOK Beginning Linux Programming, 3rd Edition 10 August 25th, 2006 10:23 AM





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