Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Mobile Development > BOOK: Beginning Android 4 Application Development
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Android 4 Application Development
This is the forum to discuss the Wrox book Beginning Android 4 Application Development by Wei-Meng Lee; ISBN: 978-1-1181-9954-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Android 4 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 July 17th, 2013, 05:17 AM
Authorized User
Points: 170, Level: 3
Points: 170, Level: 3 Points: 170, Level: 3 Points: 170, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 43
Thanks: 11
Thanked 0 Times in 0 Posts
Question Chapter 2, pg 82. "R.layout.main" Error

Hi, I am currently on page 82 in chapter 2, the "Communication between fragments" exercise:

In the Main Activity, the book instructs you to enter the following code:
Code:
public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
I have a problem with the last line, it says that "main cannot be resolved or is not a field" and I don't understand the error,

Update
Fixed the problem, basically I didn't think, I changed the setContentView so that it actually referenced my activity as it had the wrong name

Thanks very much,

Nick

Last edited by Nick Makin; July 17th, 2013 at 06:22 AM..
Reply With Quote
  #2 (permalink)  
Old July 17th, 2013, 08:45 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

check that the activity name is actually main, in the new java the default name is something like MainActivity or something like that
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
Exception in thread "main" javax.crypto.BadPadd?ingException: pad block corrupted boy18nj BOOK: Beginning Cryptography with Java 9 June 6th, 2011 12:50 AM
Chapter 15. "Sign Up for new account" gets error: 26 - Error Locating Server/Instance Tanya Roslyakova BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 March 8th, 2011 10:34 AM
Chapter 6 - pg.228 ThemeList "not declared" lsochia BOOK: Beginning ASP.NET 4 : in C# and VB 3 February 8th, 2011 03:50 AM
MSXSL gives error message for "for" inside "select" ilyaz XSLT 1 December 9th, 2010 05:02 PM
Add a CheckBox DataColumn to my DataGridView, Null format: "" or "True" but Error: F ismailc C# 2005 0 September 25th, 2009 04:56 AM



All times are GMT -4. The time now is 10:48 PM.


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