On Mon, Jun 6, 2011 at 2:55 PM, dillipk <[email protected]> wrote: > I am trying to list out the following email clients/social > networking client in a menu by using following code: > > final Intent emailIntent = new > Intent(android.content.Intent.ACTION_SEND); > emailIntent.setType("text/plain"); > Intent i = Intent.createChooser(emailIntent, "Share Offer"); > startActivity(i);
No, your code is going to "list out" anything that can send plain text. I am not aware of any standards with respect to a "social networking client". Moreover, this is not a menu. It is an activity. > - How can I remove the non-required items from the Menu? You can't. I am not aware of an Internet-registered MIME type that is "email clients/social networking clients". You can limit things to email clients by using the message/rfc822 MIME type, and it is possible that some "social networking clients" might happen to honor that. The objective of createChooser() is to allow the user to share content by any means available given the type of data. > - Can I insert a customized menu item in the above menu created by > Intent.createChooser(..) ? You can implement your own activity that supports the MIME type your request, though I don't know what determines the sort order in the ListView. > - How can I handle the Menu Item Click in this case? For examlpe: If > user clicks "Gmail", how do I handle the onClick event? You don't. When the user clicks the list item, the activity the user requested is started. That *is* why you called startActivity(), right? -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.6 Available! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

