Wrox Programmer Forums
|
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 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 July 19th, 2013, 04:59 AM
Registered User
 
Join Date: Jul 2013
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default p.56

package net.learn2develop.UsingIntent;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
public class UsingIntentActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
public void onClick(View view) {
startActivity(new Intent(“net.learn2develop.SecondActivity”));
}
}

Question: Since package is package net.learn2develop.UsingIntent
how come the last line isn't: startActivity(new Intent(“net.learn2develop.UsingIntent.SecondActivity”)); ?

Whatever the book has, it's correct, namely “net.learn2develop.SecondActivity”.

Thanks.
 
Old July 19th, 2013, 05:48 AM
Registered User
 
Join Date: Jul 2013
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here's also a quick sniplet of my own code:
Using package com.example.statecapitol;



public void goShowCapitol(View view)
{
//this works: Intent i = new Intent (this, ShowCapitol.class);
// but this doesn't work:
Intent i = new Intent ( "com.example.statecapitol.ShowCapitol");
startActivity(i);
}

question: I am not sure why this would work:
Intent i = new Intent (this, ShowCapitol.class);

but this cause program to crash:
Intent i = new Intent ( "com.example.statecapitol.ShowCapitol");

Thanks.





Similar Threads
Thread Thread Starter Forum Replies Last Post
'Intent' exercise (pages 56-59) Error cckemp BOOK: Beginning Android Application Development 0 November 17th, 2011 01:19 PM
Chapter 3 page 56, UIActionSheet [email protected] BOOK: Beginning iPad Application Development 3 February 12th, 2011 10:34 PM
Access 2003 VBA PG 55-56 KellyR Access VBA 3 June 9th, 2007 08:32 AM
help an oldman (56) daviddisman C++ Programming 0 February 16th, 2007 11:53 AM
ZVON Tutorial Page 56 id() function scubaduba XSLT 1 November 1st, 2004 12:37 PM





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