Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 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 November 19th, 2011, 07:16 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
Reply With Quote
  #2 (permalink)  
Old November 21st, 2011, 01:16 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
Reply With Quote
  #3 (permalink)  
Old November 21st, 2011, 01:31 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
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
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



All times are GMT -4. The time now is 04:52 AM.


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