Wrox Programmer Forums
|
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 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 March 9th, 2010, 11:38 PM
Registered User
 
Join Date: Mar 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Intent Resolution confusion

Page 146 "How Android Resolves Intent Filters"
The text states
Quote:
2.1. "Action matches are made if the Intent Filter either includes the specified action or has no action specified"
on Android developer guide
http://developer.android.com/intl/zh...s-filters.html

the rule follows
Quote:
To pass this test, the action specified in the Intent object must match one of the actions listed in the filter. If the object or the filter does not specify an action, the results are as follows:

•If the filter fails to list any actions, there is nothing for an intent to match, so all intents fail the test. No intents can get through the filter.
•On the other hand, an Intent object that doesn't specify an action automatically passes the test — as long as the filter contains at least one action.
Therefore I think the text got mixed up between the rules applied for Intent and Intent Filters.

I think changing the text to
"Action matches are made if the Intent Filter either includes the specified action or has no action specified for Intent object"
would make more sense.

Please correct my understanding if I misunderstood any of the contents.

thanks

Last edited by fungi8210; March 10th, 2010 at 01:39 AM..
 
Old March 10th, 2010, 06:50 AM
Reto's Avatar
Wrox Author
 
Join Date: Oct 2008
Posts: 61
Thanks: 1
Thanked 7 Times in 6 Posts
Default

Yes - your understanding is correct.

Intents will resolve to any Intent Filter that includes an action tag that matches the specified Intent action, or if an Intent has no action specified it will match an Intent Filter that has at least one action tag.
__________________
Reto Meier

Author, "Professional Android 4 Application Development", Wrox, ©2012, 2010, 2008
@retomeier
 
Old March 10th, 2010, 07:15 AM
Registered User
 
Join Date: Mar 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks!
Im just a little surprised how this error can sneak through first edition and onto the second edition. But then again, it might be sdk version differences.
 
Old March 10th, 2010, 07:18 AM
Reto's Avatar
Wrox Author
 
Join Date: Oct 2008
Posts: 61
Thanks: 1
Thanked 7 Times in 6 Posts
Default

I have a feeling this behavior was different back in the early days. I can't find anything definitive though so I'll not blame that :)
__________________
Reto Meier

Author, "Professional Android 4 Application Development", Wrox, ©2012, 2010, 2008
@retomeier





Similar Threads
Thread Thread Starter Forum Replies Last Post
Confused between the rules applied to Intent and Intent Filters fungi8210 BOOK: Professional Android 2 Application Development 1 March 10th, 2010 06:48 AM
SQL SERVER - Intent Lock carumuga SQL Server 2000 2 November 20th, 2007 05:53 AM
Some confusion in these code hpatel_it ASP.NET 1.0 and 1.1 Basics 0 August 30th, 2006 08:19 AM
Some confusion as to which SQL to use mark.uk SQL Server 2000 6 August 12th, 2004 10:47 AM





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