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. If only one app can handle the content, that app will launch without you having to select from the intent chooser which app to use. Figure 4.8(b) shows the Gmail app’s Compose screen with the e-mail subject and body populated. Gmail also shows your e-mail address above the To field (we deleted the e-mail address for privacy in the screen capture).

Image

a) Intent chooser showing share options

Image

b) Gmail app Compose screen for an e-mail containing the “Deitel” search

Fig. 4.8 | Sharing a search via e-mail.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset