Wrox Programmer Forums
|
BOOK: Beginning Android Application Development
This is the forum to discuss the Wrox book Beginning Android Application Development by Wei-Meng Lee; ISBN: 978-1-1180-1711-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Android 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 February 8th, 2012, 11:43 PM
Registered User
 
Join Date: Feb 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 2 - choosing contacts

Hi,
I am new to developing in the Android OS. I am executing the sample code (unmodified) from chapter two which shows how to use intents. when I hit the choose contact button I get my list of contacts, then select a contact from the list. The problem is: No contact information is displayed on the emulator screen, and the code seems to stop running in the "ActivityThread.deliverResults" method. However the emulator cannot find the source code to display.

Can someone please offer a suggestion: 1. why is the code stopping without an error message, 2. Where should the source be located? I have looked through the Android SDK directories for this class & method and can't find it.

Thanks very much - frustrated

dac77
 
Old February 10th, 2012, 07:57 PM
Authorized User
 
Join Date: Nov 2011
Posts: 86
Thanks: 3
Thanked 5 Times in 5 Posts
Default

Hi dac77
Well unless you have entered some contacts in the list it will be empty.
Tap on the contacts icon in the emulator and add a few contacts. then your program will respond as it should.
Second part.
Did you hit the 'back button'? It will wait for you do something.
Where should what source be located?
Cliff
__________________
"Software to the Stars"
Failure is not an option. It comes bundled with your Microsoft products.
 
Old February 10th, 2012, 10:15 PM
Registered User
 
Join Date: Feb 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Cliff,
First, thanks for the reply, you are the only one to respond.

I have added contacts to the contact list and I am able to select from
the list, so that's not a problem. The problem is after the selection is made
the code stops executing with a runtime exception (I included the call stack below). In the source code window of eclipse I get a message that says
"Source not found." The classname in the tab of the source window is the
same as the last entry in the call stack "ActivityThread.deliverResults".

So I don't know why it is getting the exception, and I'm not sure where to
look for the source code so I could add its directory to the source path.
As I mentioned this is the unmodified code, right from the example.

Any suggestions are appreciated.

Thanks much
Dave


Thread [<1> main] (Suspended (exception RuntimeException))
ActivityThread.deliverResults(ActivityThread$Activ ityClientRecord, List) line: 2532
ActivityThread.handleSendResult(ActivityThread$Res ultData) line: 2574
ActivityThread.access$2000(ActivityThread, ActivityThread$ResultData) line: 117
ActivityThread$ResultData(ActivityThread$H).handle Message(Message) line: 961
ActivityThread$H(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 3683
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 507
ZygoteInit$MethodAndArgsCaller.run() line: 839
ZygoteInit.main(String[]) line: 597
NativeStart.main(String[]) line: not available [native method]
 
Old February 11th, 2012, 07:56 PM
Authorized User
 
Join Date: Nov 2011
Posts: 86
Thanks: 3
Thanked 5 Times in 5 Posts
Default

Hi Dave
My guess is that it can't find the activity to go back to(?). Check you manifest file and see that the intent filters are good. Also check where you create the intent and make sure that you handle the return data correctly. That is, check the onActivityResult code is good.
Cliff
__________________
"Software to the Stars"
Failure is not an option. It comes bundled with your Microsoft products.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 5 - Adding Contacts to Android Emulator mabbas BOOK: Professional Android 2 Application Development 0 January 20th, 2012 08:00 AM
ch2 contacts w/ phone numbers jfgass83 BOOK: Beginning Android Application Development 0 September 13th, 2011 01:08 PM
Outlook contacts to Access lryckman Access 1 January 22nd, 2008 08:11 AM
outlook contacts page davesav VB How-To 1 February 18th, 2006 07:57 PM





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