Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Mobile Development > BOOK: Professional Android 2 Application Development
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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

<intent-filter>
<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" />
</intent-filter>

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

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.

thanks

Last edited by fungi8210; March 9th, 2010 at 11:13 PM..
Reply With Quote
  #2 (permalink)  
Old March 10th, 2010, 06:48 AM
Reto's Avatar
Wrox Author
Points: 287, Level: 5
Points: 287, Level: 5 Points: 287, Level: 5 Points: 287, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2008
Location: London, United Kingdom
Posts: 61
Thanks: 1
Thanked 7 Times in 6 Posts
Default

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
@retomeier
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 11:51 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.