Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Mobile Development > BOOK: Professional Android 2 Application Development
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:10 PM
Registered User
Join Date: Mar 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Confused between the rules applied to Intent and Intent Filters

On page 145, for action tag, it says
"Each Intent Filter must have one (and only one) action tag."
From my understanding, that rule applies to Intent, not Intent Filters.
In other words, it only makes sense to fire an Intent with one (and only one) action.

For Intent Filters though, it is possible, and reasonable, to have "more than one" action tag.
Taking the notepad example, it has more than one action in one of the <intent-filter> tag for NotesList activity

<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
<action android:name="android.intent.action.PICK" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.dir/vnd.google.note" />

another example can be found in Music native application's QueryBrowserActivity
<action android:name="android.intent.action.SEARCH" />
<action android:name="android.intent.action.MEDIA_SEARCH" />
<category android:name="android.intent.category.DEFAULT" />

Therefore, I cannot agree with the sentence "Each Intent Filter must have one (and only one) action tag."
Please correct me if I misunderstood any content.


Last edited by fungi8210; March 9th, 2010 at 11:13 PM..
Old March 10th, 2010, 06:48 AM
Reto's Avatar
Wrox Author
Join Date: Oct 2008
Posts: 61
Thanks: 1
Thanked 7 Times in 6 Posts

You're absolutely right. It's possible to have multiple actions defined for a single Intent Filter, it should read "Each Intent Filter must have at least one action tag".

Thanks for picking that up!
Reto Meier

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Applied Framework Guidance ZeroFactorial BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 7 September 15th, 2009 02:23 PM
SQL SERVER - Intent Lock carumuga SQL Server 2000 2 November 20th, 2007 05:53 AM
CSS not get applied in CR Export functionality skdevre Crystal Reports 0 April 10th, 2007 02:38 AM
Multiple xsl styles applied to central xml doc patgibbs1 XSLT 1 March 20th, 2006 11:52 AM
Where is the code for J2EE Design Patterns Applied stony All Other Wrox Books 2 May 3rd, 2004 09:54 PM

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