4.2.5. Sharing a Search

Android makes it easy for you to share various types of information from an app via e-mail, instant messaging (SMS), Facebook, Google+, Twitter and more. In this app, you can share a favorite search by long pressing the search’s tag and selecting Share from the AlertDialog that appears. This displays a so-called intent chooser (Fig. 4.8(a)), which can vary based on the type of content you’re sharing and the apps that can handle that content. In this app we’re sharing text, and the intent chooser on our phone (not the AVD) shows apps capable of handling text, such as Facebook, Gmail, Google+, Messaging (instant messaging) and Twitter. If no apps can handle the content, the intent chooser will display a message saying so. ...

Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.