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 August 15th, 2011, 10:09 PM
Registered User
 
Join Date: Aug 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Chapter 2 - MyBrowserActivity

I am following along with the book to the key, even checked the source code, errata, etc. and I could not find out why, when I go to click the "Launch My Browser" button, it gives me an error on LogCat saying:

08-15 21:44:21.623: ERROR/AndroidRuntime(4823): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.android.MyBrowser dat=http://www.google.ca }

I have gone through both the source code and the code I have taken from the book side by side and I can't figure out why this is happening. Can someone give me a hand with this?
 
Old August 17th, 2011, 03:58 PM
Registered User
 
Join Date: Jun 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In my example I have the Intent calling net.learn2develop.MyBrowser, which is what's in the book. Your log entry has com.android.MyBrowser, so that could be your problem but it depends on how you've set up the project.

It could also mean that the line

<action android:name="net.learn2develop.MyBrowser" />

is not in your android manifest file under the .MyBrowserActivity activity.

Last edited by androider; August 17th, 2011 at 04:33 PM..
 
Old August 17th, 2011, 09:44 PM
Registered User
 
Join Date: Aug 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Red face

@ androiduser

I thought that same exact thing, but then I got looking very carefully at the lines between the <intent-filter> in the AndroidManifest.xml file, and that is where I saw

<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="com.android.MyBrowser"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="http"/>
</intent-filter>

as

<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="com.android.MyBrowser"/>
<action android:name="android.intent.category.DEFAULT"/>
<data android:scheme="http"/>
</intent-filter>

so I changed action to category and it worked!! Simple reading error :P
 
Old October 4th, 2011, 03:54 PM
Registered User
 
Join Date: Oct 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default MyBrowserActivity

To add more confusion to this example. I found that only "method 3" in MainActivity.java does not work. The difference between "method 2" and "method 3" is that in method 3 the additional categories are add programmatically, in method 2 the categories are added via declarations in AndroidManifest.xml.

I tried commenting out the declarations before running with method 3 but the result is still the same, from the log:

10-04 19:39:59.917: INFO/ActivityManager(67): Starting: Intent { act=net.learn2develop.MyBrowser cat=[net.learn2develop.SomeOtherApps,net.learn2develop. OtherApps] dat=http://www.amazon.com } from pid 501
10-04 19:39:59.927: DEBUG/AndroidRuntime(501): Shutting down VM
10-04 19:39:59.927: WARN/dalvikvm(501): threadid=1: thread exiting with uncaught exception (group=0x40015560)
10-04 19:39:59.937: ERROR/AndroidRuntime(501): FATAL EXCEPTION: main
10-04 19:39:59.937: ERROR/AndroidRuntime(501): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=net.learn2develop.MyBrowser cat=[net.learn2develop.SomeOtherApps,net.learn2develop. OtherApps] dat=http://www.amazon.com }


Any ideas as to what may be going on here?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 6 - Code Download Missing for this Chapter dbaechtel BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 0 August 11th, 2009 11:02 AM
Chapter 2 - End of chapter exercises whizzkid1892 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 July 30th, 2008 12:02 PM
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 09:40 PM





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